@required_admin
def get(self):
i want to use this method to make user must be admin.
thanks
@required_admin
def get(self):
i want to use this method to make user must be admin.
thanks
The standard route is to use login: admin
in your app.yaml
, but here's a decorator:
def admin_required(handler_method):
def check_admin(self, *args):
if not users.is_current_user_admin():
self.redirect(users.create_login_url(self.request.uri))
return
else:
handler_method(self, *args)
return check_admin