project/scipycon/registration/views.py
branchpayments
changeset 276 325ec5a41269
parent 263 02593358eddc
parent 275 679a9cab4bf1
child 291 182b03a1e6fe
equal deleted inserted replaced
268:2d47a3eb5ec4 276:325ec5a41269
    56     """Allows users that submitted a registration to edit it.
    56     """Allows users that submitted a registration to edit it.
    57     """
    57     """
    58 
    58 
    59     scope_entity = Event.objects.get(scope=scope)
    59     scope_entity = Event.objects.get(scope=scope)
    60 
    60 
    61     reg = Registration.objects.get(pk=id)
    61     reg = Registration.objects.get(pk=int(id))
    62     wifi = Wifi.objects.get(user=reg.registrant)
    62     wifi = Wifi.objects.get(user=reg.registrant)
    63 
    63 
    64     # TODO: This is an ugly hack to add accommodation and payment forms
    64     # TODO: This is an ugly hack to add accommodation and payment forms
    65     # details at later stage for SciPy.in 2010. This must be removed for
    65     # details at later stage for SciPy.in 2010. This must be removed for
    66     # SciPy.in 2011
    66     # SciPy.in 2011
   125             'allow_contact' : reg.allow_contact,
   125             'allow_contact' : reg.allow_contact,
   126             })
   126             })
   127         wifi_form = WifiForm(initial={
   127         wifi_form = WifiForm(initial={
   128             'user': wifi.user,
   128             'user': wifi.user,
   129             'scope': wifi.scope,
   129             'scope': wifi.scope,
   130             'wifi': wifi.wifi
   130             'wifi': wifi.wifi,
       
   131             'registration_id': wifi.registration_id
   131             })
   132             })
   132         acco_form = AccommodationForm(initial={
   133         acco_form = AccommodationForm(initial={
   133             'user': acco.user,
   134             'user': acco.user,
   134             'scope': acco.scope,
   135             'scope': acco.scope,
   135             'sex': acco.sex,
   136             'sex': acco.sex,
   261 
   262 
   262             wifi = wifi_form.save(registrant, scope_entity)
   263             wifi = wifi_form.save(registrant, scope_entity)
   263             acco = acco_form.save(registrant, scope_entity)
   264             acco = acco_form.save(registrant, scope_entity)
   264             payment = payment_form.save(registrant, scope_entity)
   265             payment = payment_form.save(registrant, scope_entity)
   265 
   266 
   266             send_confirmation(registrant, scope_entity,password=passwd)
   267             send_confirmation(registrant, scope_entity, password=passwd)
   267 
   268 
   268             redirect_to = reverse('scipycon_registrations',
   269             redirect_to = reverse('scipycon_registrations',
   269                                   kwargs={'scope': scope})
   270                                   kwargs={'scope': scope})
   270             return set_message_cookie(redirect_to,
   271             return set_message_cookie(redirect_to,
   271                     msg = u'Thank you, your registration has been submitted '\
   272                     msg = u'Thank you, your registration has been submitted '\