Force upnprint badge

So automation can try again
This commit is contained in:
Sachi King 2018-01-21 15:10:57 +11:00
parent be00f257a1
commit 568536532c
3 changed files with 11 additions and 1 deletions

View file

@ -98,6 +98,10 @@ class CheckIn(models.Model):
self.badge_printed = True
self.save()
def unset_badge(self):
self.badge_printed = False
self.save()
def mark_schwag_given(self):
self.schwag_given = True
self.save()

View file

@ -72,11 +72,15 @@
<dl class="dl-horizontal">
<dt>Status</dt><dd>{% if check_in.badge_printed %}Marked{% else %}Not marked{% endif %} as printed</dd>
</dl>
<form method="post">
<form method="post" hidden>
<input type="checkbox" name="badge" value="badge" checked hidden>
<a type="button" class="btn btn-primary" href="badge">Show Badge</a>
<input class="btn {% if check_in.badge_printed %}btn-danger{% else %}btn-success{% endif %} pull-right" type="submit" value="Submit">
</form>
<form method="post">
<input type="checkbox" name="unbadge" value="unbadge" checked hidden>
<input class="btn btn-danger pull-right" type="submit" value="Force Reprint">
</form>
</div>
</div>

View file

@ -312,6 +312,8 @@ def check_in_overview(request, access_code):
check_in.bulk_mark_given()
elif 'exception' in request.POST:
check_in.set_exception(request.POST['exception'])
elif 'unbadge' in request.POST:
check_in.unset_badge()
return redirect(request.path)
ctx = {
'check_in': check_in,