With the new rename, there is now the concept of a root url for a
conference, being /events/<conferenename>/. If the user goes there, is
logged in and has a registration, then redirect to the registration
dashboard which has all the info for the user. In all other cases,
redirect to the conference homepage URL.
'invoices': invoices,
})
+def confhome(request, confname):
+ conference = get_object_or_404(Conference, urlname=confname)
+
+ # If there is a registration, redirect to the registration dashboard.
+ # If not, or if the user is not logged in, redirect to the conference homepage.
+ if request.user.is_authenticated():
+ if ConferenceRegistration.objects.filter(conference=conference, attendee=request.user).exists():
+ return HttpResponseRedirect('register/')
+
+ return HttpResponseRedirect(conference.confurl)
+
@login_required
@transaction.atomic
def home(request, confname):
(r'^events/sponsor/', include('postgresqleu.confsponsor.urls')),
+ # "Homepage" for events
+ (r'^events/([^/]+)/$', postgresqleu.confreg.views.confhome),
+
# Mobile conference stuff
(r'^m/(\w+)/$', postgresqleu.confreg.mobileviews.index),
(r'^m/(\w+)/cache.manifest/$', postgresqleu.confreg.mobileviews.cachemanifest),