diff options
Diffstat (limited to 'pysite')
| -rw-r--r-- | pysite/decorators.py | 3 | 
1 files changed, 3 insertions, 0 deletions
| diff --git a/pysite/decorators.py b/pysite/decorators.py index 93e015e4..8abde932 100644 --- a/pysite/decorators.py +++ b/pysite/decorators.py @@ -23,6 +23,9 @@ def require_roles(*roles: int):                      if role in data["roles"]:                          return f(self, *args, **kwargs) +                if isinstance(self, APIView): +                    return self.error(ErrorCodes.unauthorized) +                  raise Forbidden()              return redirect(url_for("discord.login"))          return inner | 
