mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
Launderette and product list fixes
This commit is contained in:
parent
d23e07363d
commit
4c2bf9cbf9
@ -269,7 +269,7 @@ class Selling(models.Model):
|
||||
self.customer.amount -= self.quantity * self.unit_price
|
||||
self.customer.save()
|
||||
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()
|
||||
sub = Subscription(
|
||||
member=s,
|
||||
@ -284,7 +284,7 @@ class Selling(models.Model):
|
||||
duration=settings.SITH_SUBSCRIPTIONS[sub.subscription_type]['duration'],
|
||||
start=sub.subscription_start)
|
||||
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()
|
||||
sub = Subscription(
|
||||
member=s,
|
||||
|
@ -5,7 +5,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if tab == "products" %}
|
||||
{% if current_tab == "products" %}
|
||||
<p><a href="{{ url('counter:new_product') }}">{% trans %}New product{% endtrans %}</a></p>
|
||||
{% endif %}
|
||||
{% if product_list %}
|
||||
|
Loading…
Reference in New Issue
Block a user