account update scope

This commit is contained in:
Sayyid Hamid Mahdavi 2020-10-11 12:19:15 +03:30
parent 496dbc481d
commit 506b30096e
2 changed files with 22 additions and 23 deletions

View file

@ -37,11 +37,11 @@ class UserDetailView(generics.RetrieveAPIView):
class AccountView(generics.RetrieveUpdateAPIView):
serializer_class = AccountSerializer
authentication_classes = [OAuth2Authentication]
permission_classes = [TokenMatchesOASRequirements]
required_alternate_scopes = {
"GET": [["accounts.account:retrieve"]],
"POST": [["accounts.account:update"]],
"PUT": [["accounts.account:update"]],
}
def get_object(self):

View file

@ -107,7 +107,6 @@ TEMPLATES = [
]
AUTHENTICATION_BACKENDS = (
# TODO: where use this?
'apps.users.backends.OTPBackend',
'django.contrib.auth.backends.ModelBackend',
)