mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-03 16:41:27 +01:00
updated ratelimit settings
This commit is contained in:
1 parent
b832ec5a42
commit
854879b022
2 files changed
+6
-1
No files matched your search
@@ -35,6 +35,9 @@ class RatingViewSet(viewsets.ModelViewSet):
|
||||
permission_classes = [permissions.IsAuthenticatedOrReadOnly]
|
||||
|
||||
@method_decorator(ratelimit(key='user', rate='10/m', method='POST', block=True))
|
||||
def create(self, request, *args, **kwargs):
|
||||
return super().create(request, *args, **kwargs)
|
||||
|
||||
def perform_create(self, serializer):
|
||||
# Ensure user can only have one rating per flavor
|
||||
flavor = serializer.validated_data['flavor']
|
||||
|
||||
@@ -11,8 +11,10 @@ python manage.py migrate
|
||||
echo "Collecting static files..."
|
||||
python manage.py collectstatic --no-input
|
||||
|
||||
# Ensure media directory exists
|
||||
# Ensure media and cache directories exist
|
||||
mkdir -p media/flavors
|
||||
mkdir -p django_cache
|
||||
chmod -R 777 django_cache
|
||||
|
||||
# Sync flavors from the API
|
||||
echo "Syncing flavors..."
|
||||
|
||||
Reference in new issue
Block a user