from catalogue.utils import AppSettings
-default_app_config = 'catalogue.apps.CatalogueConfig'
-
-
class Settings(AppSettings):
"""Default settings for catalogue app."""
DEFAULT_LANGUAGE = 'pol'
queryset = Tag.objects.all()
def get_object(self):
- return get_object_or_404(
- Tag,
- category=self.kwargs['category'],
- slug=self.kwargs['slug']
- )
+ try:
+ return get_object_or_404(
+ Tag,
+ category=self.kwargs['category'],
+ slug=self.kwargs['slug']
+ )
+ except Http404:
+ if self.method == 'PUT':
+ return Tag(
+ category=self.kwargs['category'],
+ slug=self.kwargs['slug']
+ )
+ else:
+ raise
def post(self, request, **kwargs):
data = json.loads(request.POST.get('data'))
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.utils.translation import gettext
-
from .celery import app as celery_app
-
-default_app_config = 'wolnelektury.apps.WLCoreConfig'