def update_personal(request, event_url_name, helper_id): event, job, shift, helper = get_or_404(event_url_name, helper_pk=helper_id) if not event.changes_possible: context = {'event': event} return render(request, 'registration/changes_not_possible.html', context) form = HelperForm(request.POST or None, instance=helper, event=event, public=True) if form.is_valid(): form.save(request=request) logger.info("helper dataupdated", extra={ 'event': event, 'helper': helper, "helper_pk": helper_id, }) return HttpResponseRedirect(reverse('registered', args=[event.url_name, helper.pk])) news = news_test_email(helper.email) # needed in template context = {'event': event, 'data': helper, 'news': news, 'personal_data_form': form} return render(request, 'registration/registered.html', context)
def registered(request, event_url_name, helper_id=None): event, job, shift, helper = get_or_404(event_url_name, helper_pk=helper_id) news = news_test_email(helper.email) context = {'event': event, 'data': helper, 'news': news} return render(request, 'registration/registered.html', context)