Pass in 'conference' to dashboard
authorMagnus Hagander <magnus@hagander.net>
Mon, 25 Jun 2018 14:31:17 +0000 (16:31 +0200)
committerMagnus Hagander <magnus@hagander.net>
Mon, 25 Jun 2018 14:32:00 +0000 (16:32 +0200)
We used 'c' to make it shorter to type, but that breaks some access in
shared templates. Instead use a with construct in the template to
achieve the same thing, and pass in the standard variable.

postgresqleu/confreg/views.py
template/confreg/admin_dashboard_single.html

index 8f95f5180e1e55966c7a04b98f55f8dca0c7393d..8af1ac106e472afe7fc93e9e29c8fe8f3cf82a51 100644 (file)
@@ -2439,7 +2439,7 @@ def admin_dashboard_single(request, urlname):
        conference = get_authenticated_conference(request, urlname)
 
        return render(request, 'confreg/admin_dashboard_single.html', {
-               'c': conference,
+               'conference': conference,
                'pending_session_notifications': conference.pending_session_notifications,
                'pending_waitlist': RegistrationWaitlistEntry.objects.filter(registration__conference=conference, offeredon__isnull=True).exists(),
                'unregistered_staff': exec_to_scalar("SELECT EXISTS (SELECT user_id FROM confreg_conference_staff s WHERE s.conference_id=%(confid)s AND NOT EXISTS (SELECT 1 FROM confreg_conferenceregistration r WHERE r.conference_id=%(confid)s AND payconfirmedat IS NOT NULL AND attendee_id=s.user_id))", {'confid': conference.id}),
index df307c77c5458799f596cadf1c5e84f16fd9c9e2..c75dcb9f110dcf90e576b9528da3bccdca22ba9a 100644 (file)
@@ -1,6 +1,7 @@
 {%extends "confreg/confadmin_base.html" %}
 {%block title%}{{c.conferencename}} - dashboard{%endblock%}
 {%block layoutblock%}
+{%with conference as c%}
 
 <h1>{{c.conferencename}}</h1>
 <div>
   <div class="col-md-3 col-sm-6 col-xs-12 buttonrow"><a class="btn btn-default btn-block" href="/events/sponsor/signup/{{c.urlname}}/">Sponsor signup</a></div>
 </div>
 
+{%endwith%}
 {%endblock%}