From 73eac1886a80fa2b3725b29a5b0602aed321363c Mon Sep 17 00:00:00 2001 From: Basile Clement Date: Fri, 15 Jul 2016 01:18:31 +0200 Subject: [PATCH] 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. --- gestioncof/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gestioncof/views.py b/gestioncof/views.py index 11d15d53..f3d677d9 100644 --- a/gestioncof/views.py +++ b/gestioncof/views.py @@ -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(