Fix bug when user arrives at SubscriptionCreateView to reroute if no subscription
This commit is contained in:
parent
df47f28273
commit
d3f41ff13b
@ -626,6 +626,11 @@ class SubscriptionCreateView(SuccessMessageMixin, CreateView):
|
|||||||
template_name = 'storefront/subscription/create_form.html'
|
template_name = 'storefront/subscription/create_form.html'
|
||||||
fields = []
|
fields = []
|
||||||
|
|
||||||
|
def get(self, request, *args, **kwargs):
|
||||||
|
if not self.request.session.get('subscription'):
|
||||||
|
return HttpResponseRedirect(reverse('storefront:subscription-form'))
|
||||||
|
return super().get(request, *args, **kwargs)
|
||||||
|
|
||||||
def get_item_list(self):
|
def get_item_list(self):
|
||||||
item_list = [{
|
item_list = [{
|
||||||
'product': Product.objects.get(pk=item['pk']),
|
'product': Product.objects.get(pk=item['pk']),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user