Allow talk vote status change by admins
authorMagnus Hagander <magnus@hagander.net>
Fri, 24 Aug 2018 08:52:52 +0000 (10:52 +0200)
committerMagnus Hagander <magnus@hagander.net>
Fri, 24 Aug 2018 08:53:49 +0000 (10:53 +0200)
Previously it was only possible to change the status if someone was
*both* a voter *and* an admin. But the admins would still get the button
(but not talkvoters).

postgresqleu/confreg/views.py

index 2f7fbe719e8e69357c53a575753feb90017feafe..62d134992863db8c284fcdb6ca2b03e1cc755317 100644 (file)
@@ -2179,7 +2179,7 @@ def talkvote(request, confname):
 @transaction.atomic
 def talkvote_status(request, confname):
        conference = get_object_or_404(Conference, urlname=confname)
-       if not conference.talkvoters.filter(pk=request.user.id):
+       if not conference.talkvoters.filter(pk=request.user.id) and not conference.administrators.filter(pk=request.user.id):
                return HttpResponse('You are not a talk voter for this conference!')
 
        isadmin = conference.administrators.filter(pk=request.user.id).exists()