Skip to content

Commit 13bd9e1

Browse files
committed
Merged in [13905] from david.i.allan@ericsson.com:
Fixes issue ietf-tools#2183. 2183 fix to status update forms - Legacy-Id: 13914 Note: SVN reference [13905] has been migrated to Git commit 6964155
2 parents 5fe98e4 + 6964155 commit 13bd9e1

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

ietf/group/forms.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def roles_for_group_type(group_type):
3434
# --- Forms ------------------------------------------------------------
3535

3636
class StatusUpdateForm(forms.Form):
37-
content = forms.CharField(widget=forms.Textarea, label='Status update', help_text = 'Edit the status update', required=False, strip=False)
37+
content = forms.CharField(widget=forms.Textarea, label='Status update', help_text = "Enter the status update", required=False, strip=False)
3838
txt = forms.FileField(label='.txt format', help_text='Or upload a .txt file', required=False)
3939

4040
def clean_content(self):
@@ -43,6 +43,13 @@ def clean_content(self):
4343
def clean_txt(self):
4444
return get_cleaned_text_file_content(self.cleaned_data["txt"])
4545

46+
def clean(self):
47+
if (self.cleaned_data['content'] and self.cleaned_data['content'].strip() and self.cleaned_data['txt']):
48+
raise forms.ValidationError("Cannot enter both text box and TXT file")
49+
elif (self.cleaned_data['content'] and not self.cleaned_data['content'].strip() and not self.cleaned_data['txt']):
50+
raise forms.ValidationError("NULL input is not a valid option")
51+
elif (self.cleaned_data['txt'] and not self.cleaned_data['txt'].strip()) :
52+
raise forms.ValidationError("NULL TXT file input is not a valid option")
4653

4754
class ConcludeGroupForm(forms.Form):
4855
instructions = forms.CharField(widget=forms.Textarea(attrs={'rows': 30}), required=True, strip=False)

0 commit comments

Comments
 (0)