Browse Source

Person: uprava editace, Moznost nevyplnit PSC

master
Martin Rejman 3 years ago
parent
commit
94bcf44c96
  1. 2
      src/nalodeni/models.py
  2. 2
      src/nalodeni/people.py

2
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,

2
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()

Loading…
Cancel
Save