Skip to content

Commit

Permalink
Temporarily remove the need to set-up a "registration user"
Browse files Browse the repository at this point in the history
This was causing problems, specially on the iOS app
  • Loading branch information
rolandgeider committed Nov 7, 2024
1 parent 540f210 commit cf691a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions wger/core/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
from wger.utils.api_token import create_token
from wger.utils.permissions import WgerPermission


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -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):
"""
Expand All @@ -327,7 +327,7 @@ def post(self, request):
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.user
user.userprofile.save()
token = create_token(user)

Expand Down
4 changes: 2 additions & 2 deletions wger/settings_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from wger import get_version
from 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:
Expand Down Expand Up @@ -461,7 +460,8 @@
),
'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',
}
Expand Down

0 comments on commit cf691a6

Please sign in to comment.