diff --git a/aleksis/core/apps.py b/aleksis/core/apps.py index d9a3f38fa379ddebb10073f7b5afd53301984da1..c14af908faab80f884372e60c6a7ba3ccb8378d0 100644 --- a/aleksis/core/apps.py +++ b/aleksis/core/apps.py @@ -138,7 +138,8 @@ class CoreConfig(AppConfig): # Save the associated person to pick up defaults user.person.save() - def get_all_scopes(self) -> dict[str, str]: + @classmethod + def get_all_scopes(cls) -> dict[str, str]: scopes = { "read": "Read anything the resource owner can read", "write": "Write anything the resource owner can write", diff --git a/aleksis/core/util/apps.py b/aleksis/core/util/apps.py index 5c31ae54acdb711d42084ac9ee4fd52d0335729a..8157f1dcf2668aac249e107b3e37c1b3676ebeed 100644 --- a/aleksis/core/util/apps.py +++ b/aleksis/core/util/apps.py @@ -217,22 +217,25 @@ class AppConfig(django.apps.AppConfig): """ pass - def get_all_scopes(self) -> dict[str, str]: + @classmethod + def get_all_scopes(cls) -> dict[str, str]: """Return all OAuth scopes and their descriptions for this app.""" return {} + @classmethod def get_available_scopes( - self, + cls, application: Optional["AbstractApplication"] = None, request: Optional[HttpRequest] = None, *args, **kwargs, ) -> list[str]: """Return a list of all OAuth scopes available to the request and application.""" - return list(self.get_all_scopes().keys()) + return list(cls.get_all_scopes().keys()) + @classmethod def get_default_scopes( - self, + cls, application: Optional["AbstractApplication"] = None, request: Optional[HttpRequest] = None, *args,