|
@ -1026,24 +1026,16 @@ def logoutView(request): |
|
|
return render(request, 'seminar/login.html', {'form': form}) |
|
|
return render(request, 'seminar/login.html', {'form': form}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def prihlaska_log_gdpr_safe(logger, gdpr_logger, msg, form_data): |
|
|
|
|
|
msg = "{}, form_hash:{}".format(msg,hash(form_data)) |
|
|
|
|
|
logger.warn(msg) |
|
|
|
|
|
gdpr_logger.warn(msg+", form:{}".format(form_data)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def prihlaskaView(request): |
|
|
def prihlaskaView(request): |
|
|
generic_logger = logging.getLogger('seminar.prihlaska') |
|
|
|
|
|
err_logger = logging.getLogger('seminar.prihlaska.problem') |
|
|
err_logger = logging.getLogger('seminar.prihlaska.problem') |
|
|
form_logger = logging.getLogger('seminar.prihlaska.form') |
|
|
form_logger = logging.getLogger('seminar.prihlaska.form') |
|
|
if request.method == 'POST': |
|
|
if request.method == 'POST': |
|
|
form = PrihlaskaForm(request.POST) |
|
|
form = PrihlaskaForm(request.POST) |
|
|
# TODO vyresit, co se bude v jakych situacich zobrazovat |
|
|
|
|
|
if form.is_valid(): |
|
|
if form.is_valid(): |
|
|
generic_logger.info("Form valid") |
|
|
|
|
|
fcd = form.cleaned_data |
|
|
fcd = form.cleaned_data |
|
|
form_hash = hash(fcd) |
|
|
form_hash = hash(frozenset(fcd.items())) |
|
|
form_logger.info(fcd,form_hash=form_hash) |
|
|
fcd["hash"] = form_hash |
|
|
|
|
|
form_logger.info(fcd) |
|
|
|
|
|
|
|
|
with transaction.atomic(): |
|
|
with transaction.atomic(): |
|
|
u = User.objects.create_user( |
|
|
u = User.objects.create_user( |
|
@ -1072,8 +1064,7 @@ def prihlaskaView(request): |
|
|
o.stat = fcd['stat'] |
|
|
o.stat = fcd['stat'] |
|
|
else: |
|
|
else: |
|
|
# Unknown country - log it |
|
|
# Unknown country - log it |
|
|
msg = "Unknown country {}".format(fcd['stat_text']) |
|
|
err_logger.warn("Unknown country {}. Form hash:{}".format(fcd['stat_text'],form_hash)) |
|
|
err_logger.warn(msg,form_hash=form_hash) |
|
|
|
|
|
|
|
|
|
|
|
o.save() |
|
|
o.save() |
|
|
o.user = u |
|
|
o.user = u |
|
@ -1090,8 +1081,7 @@ def prihlaskaView(request): |
|
|
r.skola = fcd['skola'] |
|
|
r.skola = fcd['skola'] |
|
|
else: |
|
|
else: |
|
|
# Unknown school - log it |
|
|
# Unknown school - log it |
|
|
msg = "Unknown school {}, {}".format(fcd['skola_nazev'],fcd['skola_adresa']) |
|
|
err_logger.warn("Unknown school {}, {}. Form hash:{}".format(fcd['skola_nazev'],fcd['skola_adresa'],form_hash)) |
|
|
err_logger.warn(msg,form_hash=form_hash) |
|
|
|
|
|
r.save() |
|
|
r.save() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|