mirror of
https://github.com/logos-co/open-law.git
synced 2025-02-13 07:16:25 +00:00
ignore flask admin warnings
This commit is contained in:
parent
39411129fe
commit
127d585f79
@ -110,28 +110,33 @@ def create_app(environment="development"):
|
||||
index_view=CustomAdminIndexView(),
|
||||
)
|
||||
|
||||
for view in [
|
||||
UsersView(m.User, db.session, name="User", endpoint="/user_"),
|
||||
BooksView(m.Book, db.session, name="Book", endpoint="/book_"),
|
||||
CollectionsView(
|
||||
m.Collection, db.session, name="Collection", endpoint="/collection_"
|
||||
),
|
||||
SectionsView(m.Section, db.session, name="Section", endpoint="/section_"),
|
||||
InterpretationView(
|
||||
m.Interpretation,
|
||||
db.session,
|
||||
name="Interpretation",
|
||||
endpoint="/interpretation_",
|
||||
),
|
||||
CommentView(m.Comment, db.session, name="Comment", endpoint="/comment_"),
|
||||
TagView(m.Tag, db.session, name="Tag", endpoint="/tag_"),
|
||||
BookContributorView(
|
||||
m.BookContributor,
|
||||
db.session,
|
||||
name="BookContributor",
|
||||
endpoint="/book_contributor_",
|
||||
),
|
||||
]:
|
||||
admin.add_view(view)
|
||||
import warnings
|
||||
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore", "Fields missing from ruleset", UserWarning)
|
||||
|
||||
for view in [
|
||||
UsersView(m.User, db.session, name="User", endpoint="/user_"),
|
||||
BooksView(m.Book, db.session, name="Book", endpoint="/book_"),
|
||||
CollectionsView(
|
||||
m.Collection, db.session, name="Collection", endpoint="/collection_"
|
||||
),
|
||||
SectionsView(m.Section, db.session, name="Section", endpoint="/section_"),
|
||||
InterpretationView(
|
||||
m.Interpretation,
|
||||
db.session,
|
||||
name="Interpretation",
|
||||
endpoint="/interpretation_",
|
||||
),
|
||||
CommentView(m.Comment, db.session, name="Comment", endpoint="/comment_"),
|
||||
TagView(m.Tag, db.session, name="Tag", endpoint="/tag_"),
|
||||
BookContributorView(
|
||||
m.BookContributor,
|
||||
db.session,
|
||||
name="BookContributor",
|
||||
endpoint="/book_contributor_",
|
||||
),
|
||||
]:
|
||||
admin.add_view(view)
|
||||
|
||||
return app
|
||||
|
Loading…
x
Reference in New Issue
Block a user