Add discussion api

This commit is contained in:
Matt Tuchfarber
2019-02-28 16:35:09 -05:00
parent 5a0659ed9e
commit eec95cf538
8 changed files with 162 additions and 3 deletions

View File

@@ -6,8 +6,6 @@ from __future__ import unicode_literals
from django.conf import settings
from rest_framework import permissions
USERNAME_REPLACEMENT_GROUP = "username_replacement_admin"
class CanDeactivateUser(permissions.BasePermission):
"""
Grants access to AccountDeactivationView if the requesting user is a superuser

View File

@@ -1014,6 +1014,9 @@ class UsernameReplacementView(APIView):
API will recieve a list of current usernames and their requested new
username. If their new username is taken, it will randomly assign a new username.
This API will be called first, before calling the APIs in other services as this
one handles the checks on the usernames provided.
"""
authentication_classes = (JwtAuthentication, )
permission_classes = (permissions.IsAuthenticated, CanReplaceUsername)