Fix semantic error in events

`gestioncof.views.registration` was using an `event` variable that was
not properly defined. Due to a semantics oddity of python2, the value
used was from a previous and (somewhat) unrelated list comprehension.
This commit is contained in:
Basile Clement 2016-07-15 01:18:31 +02:00
parent 7f61870236
commit 73eac1886a

View file

@ -453,13 +453,13 @@ def registration(request):
(current_registration, created_reg) = \
EventRegistration.objects.get_or_create(user=member,
event=form.event)
update_event_form_comments(event, form, current_registration)
update_event_form_comments(form.event, form, current_registration)
current_registration.options = all_choices
current_registration.paid = \
(form.cleaned_data['status'] == 'paid')
current_registration.save()
if event.title == "Mega 15" and created_reg:
field = EventCommentField.objects.get(event=event,
if form.event.title == "Mega 15" and created_reg:
field = EventCommentField.objects.get(event=form.event,
name="Commentaires")
try:
comments = EventCommentValue.objects.get(