Skip to content

Commit af8cd51

Browse files
committed
Merged in [8845] from rcross@amsl.com:\n allow editing of legacy disclosures which don't have required fields (set required=False).
- Legacy-Id: 8877 Note: SVN reference [8845] has been migrated to Git commit c957f33
2 parents c3ff43d + c957f33 commit af8cd51

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

ietf/ipr/forms.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,11 @@ def clean(self):
172172
super(IprDisclosureFormBase, self).clean()
173173
cleaned_data = self.cleaned_data
174174

175-
# if same_as_above not checked require submitted
176-
if not self.cleaned_data.get('same_as_ii_above'):
177-
if not ( self.cleaned_data.get('submitter_name') and self.cleaned_data.get('submitter_email') ):
178-
raise forms.ValidationError('Submitter information must be provided in section VII')
175+
if not self.instance.pk:
176+
# when entering a new disclosure, if same_as_above not checked require submitted
177+
if not self.cleaned_data.get('same_as_ii_above'):
178+
if not ( self.cleaned_data.get('submitter_name') and self.cleaned_data.get('submitter_email') ):
179+
raise forms.ValidationError('Submitter information must be provided in section VII')
179180

180181
return cleaned_data
181182

@@ -189,7 +190,13 @@ class Meta:
189190

190191
def __init__(self, *args, **kwargs):
191192
super(HolderIprDisclosureForm, self).__init__(*args, **kwargs)
192-
if not self.instance.pk:
193+
if self.instance.pk:
194+
# editing existing disclosure
195+
self.fields['patent_info'].required = False
196+
self.fields['holder_contact_name'].required = False
197+
self.fields['holder_contact_email'].required = False
198+
else:
199+
# entering new disclosure
193200
self.fields['licensing'].queryset = IprLicenseTypeName.objects.exclude(slug='none-selected')
194201

195202
def clean(self):

0 commit comments

Comments
 (0)