2015-11-24 13:11:46 +03:00
|
|
|
from django.conf import settings
|
|
|
|
|
2017-02-13 02:35:28 +03:00
|
|
|
from rest_framework.permissions import AllowAny
|
2015-11-24 13:11:46 +03:00
|
|
|
from rest_auth.registration.serializers import (
|
2020-03-01 05:30:21 +03:00
|
|
|
RegisterSerializer as DefaultRegisterSerializer
|
|
|
|
)
|
2015-11-24 13:11:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
serializers = getattr(settings, 'REST_AUTH_REGISTER_SERIALIZERS', {})
|
|
|
|
|
2020-03-01 05:30:21 +03:00
|
|
|
RegisterSerializer = serializers.get('REGISTER_SERIALIZER', DefaultRegisterSerializer)
|
2017-02-13 02:35:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
def register_permission_classes():
|
|
|
|
permission_classes = [AllowAny, ]
|
2017-03-19 23:21:32 +03:00
|
|
|
for klass in getattr(settings, 'REST_AUTH_REGISTER_PERMISSION_CLASSES', tuple()):
|
2020-03-01 05:30:21 +03:00
|
|
|
permission_classes.append(klass)
|
2017-02-13 02:35:28 +03:00
|
|
|
return tuple(permission_classes)
|