#101 Admin/Build Create: Use flask_wtf.Form instead of wtforms.Form
Merged 4 years ago by frantisekz. Opened 4 years ago by frantisekz.

@@ -23,6 +23,7 @@ 

  

  import koji

  from flask import flash, request, url_for, redirect

+ import flask_wtf

  import wtforms

  from flask_admin import expose

  from flask_admin.babel import gettext
@@ -41,7 +42,7 @@ 

          return self.widget(self, **kwargs)

  

  

- class BuildForm(wtforms.Form):

+ class BuildForm(flask_wtf.Form):

      nvr = ReadOnlyTextField('NVR', [wtforms.validators.required()])

  

  class BuildView(FasAuthModelView):

The "build/create" is still either broken or I don't know how to use it. At least, it doesn't crash now.

Why exactly was this change necessary? I'm not necessarily disputing the change, since I don't have the whole context (yet). it's just that validate_on_submit() is effectively is_submitted() and validate() shortcut, so...

There is no validate_on_submit() in the latest Flask (>=1.0, if I am looking properly), so it just crashes on an undefined function...

Edit: Sorry, I should've added proper description into the initial comment.

rebased onto 2510eac

4 years ago

rebased onto ecad1da

4 years ago

rebased onto 1bab845

4 years ago

Updated, replaced the only usage of wtforms.Form with flask_wtf.Form .

rebased onto 9464af9

4 years ago

Pull-Request has been merged by frantisekz

4 years ago
Metadata