Skip to content

Commit

Permalink
update render cache after saving with flask admin (#87)
Browse files Browse the repository at this point in the history
Tested manually on dev instance. Without this change adding a pool doesn't get it added to the place page.
  • Loading branch information
TomGoBravo authored Aug 20, 2023
1 parent 588ebba commit 2c69725
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tourist/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def create_form(self):
form.parent.data = parent_obj
return form

def after_model_delete(self, model):
tourist.update_render_cache(tstore.db.session)

def after_model_change(self, form, model, is_created):
tourist.update_render_cache(tstore.db.session)


class PlaceAdminModelView(TouristAdminBaseModelView):
column_list = ['name', 'short_name', 'region', 'markdown', 'parent']
Expand Down

0 comments on commit 2c69725

Please sign in to comment.