Unverified Commit 25442937 authored by Serge S. Koval's avatar Serge S. Koval Committed by GitHub

Merge pull request #1822 from jugmac00/patch-1

Simplify example code
parents f48b126d 5d546b1d
......@@ -54,15 +54,11 @@ security = Security(app, user_datastore)
# Create customized model view class
class MyModelView(sqla.ModelView):
def is_accessible(self):
if not current_user.is_active or not current_user.is_authenticated:
return False
if current_user.has_role('superuser'):
return True
return False
return (current_user.is_active and
current_user.is_authenticated and
current_user.has_role('superuser')
)
def _handle_view(self, name, **kwargs):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment