Commit 4c2bf9cb authored by Skia's avatar Skia
Browse files

Launderette and product list fixes

parent d23e0736
Pipeline #203 failed with stage
in 2 minutes and 2 seconds
...@@ -269,7 +269,7 @@ class Selling(models.Model): ...@@ -269,7 +269,7 @@ class Selling(models.Model):
self.customer.amount -= self.quantity * self.unit_price self.customer.amount -= self.quantity * self.unit_price
self.customer.save() self.customer.save()
self.is_validated = True self.is_validated = True
if self.product.id == settings.SITH_PRODUCT_SUBSCRIPTION_ONE_SEMESTER: if self.product and self.product.id == settings.SITH_PRODUCT_SUBSCRIPTION_ONE_SEMESTER:
s = Subscriber.objects.filter(id=self.customer.user.id).first() s = Subscriber.objects.filter(id=self.customer.user.id).first()
sub = Subscription( sub = Subscription(
member=s, member=s,
...@@ -284,7 +284,7 @@ class Selling(models.Model): ...@@ -284,7 +284,7 @@ class Selling(models.Model):
duration=settings.SITH_SUBSCRIPTIONS[sub.subscription_type]['duration'], duration=settings.SITH_SUBSCRIPTIONS[sub.subscription_type]['duration'],
start=sub.subscription_start) start=sub.subscription_start)
sub.save() sub.save()
elif self.product.id == settings.SITH_PRODUCT_SUBSCRIPTION_TWO_SEMESTERS: elif self.product and self.product.id == settings.SITH_PRODUCT_SUBSCRIPTION_TWO_SEMESTERS:
s = Subscriber.objects.filter(id=self.customer.user.id).first() s = Subscriber.objects.filter(id=self.customer.user.id).first()
sub = Subscription( sub = Subscription(
member=s, member=s,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if tab == "products" %} {% if current_tab == "products" %}
<p><a href="{{ url('counter:new_product') }}">{% trans %}New product{% endtrans %}</a></p> <p><a href="{{ url('counter:new_product') }}">{% trans %}New product{% endtrans %}</a></p>
{% endif %} {% endif %}
{% if product_list %} {% if product_list %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment