From 94bcf44c9612d50bd50ac6fb12e7652bcdb582df Mon Sep 17 00:00:00 2001 From: Martin Rejman Date: Fri, 12 Apr 2019 01:09:47 +0200 Subject: [PATCH] Person: uprava editace, Moznost nevyplnit PSC --- src/nalodeni/models.py | 2 +- src/nalodeni/people.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nalodeni/models.py b/src/nalodeni/models.py index a453e7a..0d4aebb 100644 --- a/src/nalodeni/models.py +++ b/src/nalodeni/models.py @@ -150,7 +150,7 @@ class AppUser(AbstractUser, DataAudited): ## # User self-editable fields ## - postcode = IntegerField(_('PSČ'), blank=False, null=True) + postcode = IntegerField(_('PSČ'), blank=True, null=True) city = CharField(_(u'Město'), max_length=120, default=None, blank=True, null=True) district = IntegerField(_('Kraj'), blank=True, null=True, diff --git a/src/nalodeni/people.py b/src/nalodeni/people.py index 8f36929..ae5750c 100644 --- a/src/nalodeni/people.py +++ b/src/nalodeni/people.py @@ -303,10 +303,12 @@ def person_edit(request, id): if request.method == "GET": form = _form(instance=obj) + form.fields['email_contact'].disabled = True elif request.method == "POST": with obj.audit_context(request.user) as ac: form = _form(request.POST, instance=obj) + form.fields['email_contact'].disabled = True if form.is_valid(): form.save()