Skip to content

Commit

Permalink
Exclude relations from ModelView
Browse files Browse the repository at this point in the history
The relations leads to flask_admin crash, so do not display nor edit
such fields.

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
  • Loading branch information
KirillSmirnov committed Jul 2, 2023
1 parent de1d208 commit b7ce6a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/flask_se_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def inaccessible_callback(self, name, **kwargs):


class SeAdminModelViewUsers(SeAdminModelView):
column_exclude_list = ["password_hash", "internship_author"]
column_exclude_list = ["password_hash", "internship_author", "current_thesises", "diploma_themes_author", "diploma_themes_consultant", "diploma_themes_thesis_supervisor", "diploma_themes_supervisor", "news", "staff", "all_user_votes", "reviewer", "thesis_on_review_author", "thesises"]
form_excluded_columns = ["password_hash", "internship_author", "current_thesises", "diploma_themes_author", "diploma_themes_consultant", "diploma_themes_thesis_supervisor", "diploma_themes_supervisor", "news", "staff", "all_user_votes", "reviewer", "thesis_on_review_author", "thesises"]

pass

Expand Down Expand Up @@ -101,8 +102,8 @@ class SeAdminModelViewStaff(SeAdminModelView):
]
}

column_exclude_list = ["supervisor", "adviser"]
form_excluded_columns = ["supervisor", "adviser"]
column_exclude_list = ["supervisor", "adviser", "current_thesises"]
form_excluded_columns = ["supervisor", "adviser", "current_thesises"]

pass

Expand Down

0 comments on commit b7ce6a2

Please sign in to comment.