Skip to content

Commit

Permalink
Merge branch 'flaskadmin/regne_null' into flask-admin
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLechemia committed Aug 1, 2023
2 parents ad5ce33 + e01064c commit df2ddab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apptax/admin/admin_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ class BibListesView(FlaskAdminProtectedMixin, ModelView):
EndpointLinkRowAction("fa fa-download", ".import_cd_nom_view", "Populate list"),
]

def on_model_change(self, form, model, is_created):
"""
Force None on empty string regne
"""
if not model.regne.regne:
model.regne = None

def render(self, template, **kwargs):
self.extra_js = [
url_for("configs.get_config"),
Expand Down

0 comments on commit df2ddab

Please sign in to comment.