From b04f7cdc3f01082d8b6f1bd2530e94a9fd98b5d2 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 11 2015 10:02:50 +0000 Subject: Create a simplied form to open new issues: IssueFormSimplified Make the regular form inherit from it to reduce code duplication (although there is plenty of it in this file) --- diff --git a/pagure/forms.py b/pagure/forms.py index 8ea955a..d34ed72 100644 --- a/pagure/forms.py +++ b/pagure/forms.py @@ -25,7 +25,23 @@ class ProjectForm(wtf.Form): ) -class IssueForm(wtf.Form): +class IssueFormSimplied(wtf.Form): + ''' Form to create or edit an issue. ''' + title = wtforms.TextField( + 'Title*', + [wtforms.validators.Required()] + ) + issue_content = wtforms.TextAreaField( + 'Content*', + [wtforms.validators.Required()] + ) + private = wtforms.BooleanField( + 'Private', + [wtforms.validators.optional()], + ) + + +class IssueForm(IssueFormSimplied): ''' Form to create or edit an issue. ''' title = wtforms.TextField( 'Title*',