Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect unit #3533

Merged
merged 5 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ def safe_key() -> str:
'rest_framework.throttling.UserRateThrottle'
],
'DEFAULT_THROTTLE_RATES': {
'anon': '4/sec',
'user': '4/sec'
'anon': '4/second',
'user': '4/second'
}

}
Expand Down
6 changes: 6 additions & 0 deletions metadeploy/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from functools import reduce
from logging import getLogger
from pathlib import Path
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page

import django_rq
from django.conf import settings
Expand Down Expand Up @@ -157,6 +159,10 @@ class ProductCategoryViewSet(viewsets.ReadOnlyModelViewSet):
serializer_class = ProductCategorySerializer
queryset = ProductCategory.objects.all()

@method_decorator(cache_page(60*60*2))
def list(self, *args, **kwargs):
return super().list(*args, **kwargs)


class ProductViewSet(
FilterAllowedByOrgMixin, GetOneMixin, viewsets.ReadOnlyModelViewSet
Expand Down
Loading