diff --git a/ietf/liaisons/forms.py b/ietf/liaisons/forms.py index 59e96e3cd84..fa1f550d05b 100644 --- a/ietf/liaisons/forms.py +++ b/ietf/liaisons/forms.py @@ -471,7 +471,6 @@ def set_to_fields(self): class OutgoingLiaisonForm(LiaisonModelForm): - from_contact = SearchableEmailField(only_users=True) approved = forms.BooleanField(label="Obtained prior approval", required=False) class Meta: @@ -501,6 +500,7 @@ def set_from_fields(self): self.fields['from_groups'].initial = [flat_choices[0][0]] if has_role(self.user, "Secretariat"): + self.fields['from_contact'] = SearchableEmailField(only_users=True) # secretariat can edit this field! return if self.person.role_set.filter(name='liaiman',group__state='active'): @@ -509,8 +509,10 @@ def set_from_fields(self): email = self.person.role_set.filter(name__in=('ad','chair'),group__state='active').first().email.address else: email = self.person.email_address() + + # Non-secretariat user cannot change the from_contact field. Fill in its value. + self.fields['from_contact'].disabled = True self.fields['from_contact'].initial = email - self.fields['from_contact'].widget.attrs['readonly'] = True def set_to_fields(self): '''Set to_groups and to_contacts options and initial value based on user diff --git a/ietf/static/css/select2.scss b/ietf/static/css/select2.scss index 4fee939bd33..44824a358a3 100644 --- a/ietf/static/css/select2.scss +++ b/ietf/static/css/select2.scss @@ -3,21 +3,3 @@ @import "bootstrap/scss/mixins"; @import "select2/src/scss/core"; @import "select2-bootstrap-5-theme/src/include-all"; - -// Propagate readonly property from input to select2 instrumentation, based on -// https://stackoverflow.com/questions/41807096/select2-make-it-readonly-not-disabled-from-js/55001516#55001516 -select[readonly].select2-hidden-accessible + .select2-container { - pointer-events: none; - touch-action: none; - - .select2-selection { - background: $form-select-disabled-bg; - color: $form-select-disabled-color; - border-color: $form-select-disabled-border-color; - box-shadow: none; - } - - .select2-selection__arrow, .select2-selection__clear { - display: none; - } -} diff --git a/ietf/utils/test_runner.py b/ietf/utils/test_runner.py index 3e53808afec..00c2e8a8be4 100644 --- a/ietf/utils/test_runner.py +++ b/ietf/utils/test_runner.py @@ -196,7 +196,6 @@ def vnu_filter_message(msg, filter_db_issues, filter_test_issues): return re.search( r"""document\ is\ not\ mappable\ to\ XML\ 1| - Attribute\ 'readonly'\ not\ allowed\ on\ element\ 'select'| ^Attribute\ 'required'\ not\ allowed\ on\ element\ 'div'| ^The\ 'type'\ attribute\ is\ unnecessary\ for\ JavaScript| is\ not\ in\ Unicode\ Normalization\ Form\ C""",