Skip to content
Snippets Groups Projects
Commit 54a14b8c authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Catch no-op on updating guardian.

parent cd1d4a57
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ from django.urls import reverse
from django.utils.translation import ugettext as _
from django.shortcuts import redirect, render
from django_tables2 import RequestConfig
from ldap import INVALID_SYNTAX
from .forms import EventFeedbackForm, EventRegisterForm
from .models import TeckidsProject, Voucher
......@@ -104,7 +105,11 @@ def register_event(request, cn):
# Either mail or mobile matches - update both and link
guardian.mail = register_form.cleaned_data['guardian_mail']
guardian.mobile = register_form.cleaned_data['guardian_mobile']
guardian.save()
try:
guardian.save()
except INVALID_SYNTAX:
# Uncritical because we hit a no-op
pass
if guardian.dn not in current_person.guardians:
current_person.guardians.append(guardian.dn)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment