Skip to content

Commit

Permalink
force regne to null
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLechemia authored and amandine-sahl committed Aug 1, 2023
1 parent ad5ce33 commit cf28328
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 cf28328

Please sign in to comment.