X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/2d538a50605add2666172861744229599487f1b2..8ba1ce3bd12a74099c4287d2bafbabcc73c648b3:/src/depot/views.py diff --git a/src/depot/views.py b/src/depot/views.py index 79760863..5236adcf 100644 --- a/src/depot/views.py +++ b/src/depot/views.py @@ -5,14 +5,14 @@ from documents.models import Book from . import models -class ShopPublishView(PermissionRequiredMixin, View): - permission_required = 'depot.add_shopbookpublish' +class SitePublishView(PermissionRequiredMixin, View): + permission_required = 'depot.add_sitebookpublish' - def post(self, request, shop_id, book_id): - shop = get_object_or_404(models.Shop, pk=shop_id) + def post(self, request, site_id, book_id): + site = get_object_or_404(models.Site, pk=site_id) book = get_object_or_404(Book, pk=book_id) try: - publish = models.ShopBookPublish.create_for(book, request.user, shop) + publish = models.SiteBookPublish.create_for(book, request.user, site) except AssertionError: pass return redirect(book.get_absolute_url())