Self hosted FLOSS fitness/workout, nutrition and weight tracker
Temporarily remove the need to set-up a "registration user"
Roland Geidercf691a62276a
diff --git a/wger/core/api/views.py b/wger/core/api/views.pyindex 6a73e8ed1..a0bde371d 100644--- a/wger/core/api/views.py+++ b/wger/core/api/views.py@@ -76,7 +76,6 @@ from wger.core.models import (from wger.utils.api_token import create_tokenfrom wger.utils.permissions import WgerPermission-logger = logging.getLogger(__name__)@@ -304,8 +303,9 @@ class UserAPIRegistrationViewSet(viewsets.ViewSet):API endpoint"""- permission_classes = (AllowRegisterUser,)+ # permission_classes = (AllowRegisterUser,)serializer_class = UserRegistrationSerializer+ throttle_scope = 'registration'def get_queryset(self):"""@@ -327,7 +327,7 @@ class UserAPIRegistrationViewSet(viewsets.ViewSet):serializer = self.serializer_class(data=data)serializer.is_valid(raise_exception=True)user = serializer.save()- user.userprofile.added_by = request.user+ # user.userprofile.added_by = request.useruser.userprofile.save()token = create_token(user)diff --git a/wger/settings_global.py b/wger/settings_global.pyindex 190408139..901371ba5 100644--- a/wger/settings_global.py+++ b/wger/settings_global.py@@ -24,7 +24,6 @@ from datetime import timedeltafrom wger import get_versionfrom wger.utils.constants import DOWNLOAD_INGREDIENT_WGER-"""This file contains the global settings that don't usually need to be changed.For a full list of options, visit:@@ -461,7 +460,8 @@ REST_FRAMEWORK = {),'DEFAULT_THROTTLE_CLASSES': ['rest_framework.throttling.ScopedRateThrottle'],'DEFAULT_THROTTLE_RATES': {- 'login': '10/min'+ 'login': '10/min',+ 'registration': '5/min'},'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',}