Skip to content

Commit f1092f5

Browse files
committed
bugfix: When replying to a message, saves the message before sending the signal. (symptom: you cannot access the pk of the message in the signal)
1 parent df047ce commit f1092f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

django_messages/forms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def save(self, sender, parent_msg=None):
3838
msg.parent_msg = parent_msg
3939
parent_msg.replied_at = timezone.now()
4040
parent_msg.save()
41+
msg.save()
4142
signals.message_repled.send(sender=ComposeForm, message=msg, user=sender)
42-
msg.save()
43-
44-
if parent_msg is None:
43+
else:
44+
msg.save()
4545
signals.message_sent.send(sender=ComposeForm, message=msg, user=sender)
4646

4747
message_list.append(msg)

0 commit comments

Comments
 (0)