diff --git a/CHANGELOG.md b/CHANGELOG.md index f00fc98..c2845a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +## [1.3.12] - 2022-05-25 +### Added +- Captcha to newsletter form + +### Changed +- Post only views to accept only POST requests + ## [1.3.11] - 2022-05-21 ### Changed - File logging handler to not propagate diff --git a/src/core/tests/test_models.py b/src/core/tests/test_models.py index 009faec..59935f9 100644 --- a/src/core/tests/test_models.py +++ b/src/core/tests/test_models.py @@ -2,7 +2,7 @@ from decimal import Decimal from django.test import TestCase from measurement.measures import Weight - +from accounts.models import User from core.models import ( Product, ProductPhoto, @@ -16,6 +16,8 @@ from core.models import ( class ProductModelTest(TestCase): + fixtures = ['accounts.json'] + @classmethod def setUpTestData(cls): Product.objects.create( diff --git a/src/storefront/templates/storefront/partials/_newsletter.html b/src/storefront/templates/storefront/partials/_newsletter.html index bc4e462..16b770e 100644 --- a/src/storefront/templates/storefront/partials/_newsletter.html +++ b/src/storefront/templates/storefront/partials/_newsletter.html @@ -1,446 +1,371 @@ -
+ + diff --git a/src/storefront/views.py b/src/storefront/views.py index a8e4c4f..0c553db 100644 --- a/src/storefront/views.py +++ b/src/storefront/views.py @@ -65,6 +65,7 @@ class CartView(TemplateView): class CartAddProductView(SingleObjectMixin, FormView): model = Product form_class = AddToCartForm + http_method_names = ['post'] def get_success_url(self): return reverse('storefront:cart-detail') @@ -90,6 +91,7 @@ class CartAddProductView(SingleObjectMixin, FormView): class CartUpdateProductView(SingleObjectMixin, FormView): model = Product form_class = UpdateCartItemForm + http_method_names = ['post'] def get_success_url(self): return reverse('storefront:cart-detail') @@ -121,9 +123,9 @@ def cart_remove_product_view(request, pk, grind): class CouponApplyView(FormView): - template_name = 'contact.html' form_class = CouponApplyForm success_url = reverse_lazy('storefront:cart-detail') + http_method_names = ['post'] def form_valid(self, form): today = timezone.localtime(timezone.now()).date()