Skip to content

Commit dec12a7

Browse files
committed
Check for existing liaison titles. Fixes ietf-tools#375
- Legacy-Id: 2509
1 parent f783847 commit dec12a7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ietf/liaisons/forms.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ def save_attachments(self, instance):
207207
attach_file.write(attached_file.read())
208208
attach_file.close()
209209

210+
def clean_title(self):
211+
title = self.cleaned_data.get('title', None)
212+
exists = bool(LiaisonDetail.objects.filter(title__iexact=title).count())
213+
if exists:
214+
raise forms.ValidationError('A liaison statement with the same title has previously been submitted.')
215+
210216

211217
class IncomingLiaisonForm(LiaisonForm):
212218

0 commit comments

Comments
 (0)