Person: uprava editace, Moznost nevyplnit PSC
This commit is contained in:
parent
e1165f31cf
commit
94bcf44c96
|
@ -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,
|
||||
|
|
|
@ -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…
Reference in New Issue