Skip to content

Commit

Permalink
Mark CFP messages read before creating the reply (fixes #1646)
Browse files Browse the repository at this point in the history
  • Loading branch information
marksteward committed May 28, 2024
1 parent 0cf80e8 commit b9b27af
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions apps/cfp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,13 @@ def proposal_messages(proposal_id):
form = MessagesForm()

if form.validate_on_submit():
# The user is replying, mark any outstanding messages as read
count = proposal.mark_messages_read(current_user)
db.session.commit()
app.logger.info(
f"Marked {count} messages from admin on proposal {proposal.id} as read"
)

if form.send.data:
msg = CFPMessage()
msg.is_to_admin = True
Expand All @@ -870,12 +877,6 @@ def proposal_messages(proposal_id):
f"✉️ New CfP message for {proposal.human_type}: {external_url('cfp_review.message_proposer', proposal_id=proposal_id)} ✉️",
)

count = proposal.mark_messages_read(current_user)
db.session.commit()
app.logger.info(
"Marked %s messages to admin on proposal %s as read" % (count, proposal.id)
)

return redirect(url_for(".proposal_messages", proposal_id=proposal_id))

messages = (
Expand Down

0 comments on commit b9b27af

Please sign in to comment.