Add max lengths when editing person name via profile view

This commit is contained in:
Lance Edgar 2022-08-25 22:15:56 -05:00
parent 6a0a4627b4
commit f005ef4d52
2 changed files with 12 additions and 3 deletions

View file

@ -69,13 +69,19 @@
<section class="modal-card-body">
<b-field label="First Name">
<b-input v-model.trim="personFirstName"></b-input>
<b-input v-model.trim="personFirstName"
:maxlength="maxLengths.person_first_name || null">
</b-input>
</b-field>
<b-field label="Middle Name">
<b-input v-model.trim="personMiddleName"></b-input>
<b-input v-model.trim="personMiddleName"
:maxlength="maxLengths.person_middle_name || null">
</b-input>
</b-field>
<b-field label="Last Name">
<b-input v-model.trim="personLastName"></b-input>
<b-input v-model.trim="personLastName"
:maxlength="maxLengths.person_last_name || null">
</b-input>
</b-field>
</section>

View file

@ -447,6 +447,9 @@ class PersonView(MasterView):
def get_max_lengths(self):
model = self.model
return {
'person_first_name': maxlen(model.Person.first_name),
'person_middle_name': maxlen(model.Person.middle_name),
'person_last_name': maxlen(model.Person.last_name),
'address_street': maxlen(model.PersonMailingAddress.street),
'address_street2': maxlen(model.PersonMailingAddress.street2),
'address_city': maxlen(model.PersonMailingAddress.city),