Skip to content

Commit

Permalink
use messages.warning for non-confirmed rsvp status (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
elmq0022 authored Dec 25, 2021
1 parent a30a3b1 commit 05a1ef8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions chipy_org/apps/meetings/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,13 @@ def get_form_class(self):
def form_valid(self, form):
# calling super.form_valid(form) also does self.object = form.save()
response = super().form_valid(form)
status = self.object.get_status_display()
messages.success(self.request, f"Your RSVP has been {status.upper()}.")
status = self.object.get_status_display().upper()
msg = f"Your RSVP has been {status}."

if self.object.status == RSVPModel.Statuses.CONFIRMED:
messages.success(self.request, msg)
else:
messages.warning(self.request, msg)
return response

def get_initial(self):
Expand Down

0 comments on commit 05a1ef8

Please sign in to comment.