Example #1
0
 def post(self, request, tourney_uuid, prop_id):
     admin_form = PropositionAdminForm(request.POST)
     if admin_form.is_valid(request.user):
         prop = admin_form.get_proposition()
         prop.is_open = False
         prop.save()
         messages.add_message(self.request, messages.SUCCESS, "Proposition closed.")
         return redirect("tournament-details", tourney_uuid)
     else:
         return HttpResponseForbidden("You can't do that.")
Example #2
0
 def post(self, request, tourney_uuid, prop_id):
     admin_form = PropositionAdminForm(request.POST)
     if admin_form.is_valid(request.user):
         prop = admin_form.get_proposition()
         prop.is_open = False
         prop.save()
         messages.add_message(self.request, messages.SUCCESS, "Proposition closed.")
         return redirect("tournament-details", tourney_uuid)
     else:
         return HttpResponseForbidden("You can't do that.")
Example #3
0
 def post(self, request, tourney_uuid, prop_id):
     admin_form = PropositionAdminForm(request.POST)
     if admin_form.is_valid(request.user):
         prop = admin_form.get_proposition()
         if prop.is_paid:
             messages.add_message(self.request, messages.ERROR, "This proposition has already been paid out. It cannot be re-opened.")
         else:
             prop.is_open = True
             prop.save()
             messages.add_message(self.request, messages.SUCCESS, "Proposition opened.")
         return redirect("tournament-details", tourney_uuid)
     else:
         return HttpResponseForbidden("You can't do that.")
Example #4
0
 def post(self, request, tourney_uuid, prop_id):
     admin_form = PropositionAdminForm(request.POST)
     if admin_form.is_valid(request.user):
         prop = admin_form.get_proposition()
         if prop.is_paid:
             messages.add_message(self.request, messages.ERROR, "This proposition has already been paid out. It cannot be re-opened.")
         else:
             prop.is_open = True
             prop.save()
             messages.add_message(self.request, messages.SUCCESS, "Proposition opened.")
         return redirect("tournament-details", tourney_uuid)
     else:
         return HttpResponseForbidden("You can't do that.")