mirror of
https://github.com/nanoy42/coope
synced 2024-11-26 06:32:27 +00:00
Merge branch 'hotfix-3.0.1' into dev
This commit is contained in:
commit
f98d524576
7 changed files with 36 additions and 3 deletions
3
CHANGELOG.md
Normal file
3
CHANGELOG.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
## v3.0.1
|
||||
* Fix page inactive
|
||||
* Fix prix dans les historiques de consommations
|
|
@ -35,7 +35,7 @@ def active_required(view):
|
|||
def wrapper(request, *args, **kwargs):
|
||||
gp,_ = GeneralPreferences.objects.get_or_create(pk=1)
|
||||
if(not gp.is_active):
|
||||
return redirect(reverse('preferences:inactif'))
|
||||
return redirect(reverse('preferences:inactive'))
|
||||
return view(request, *args, **kwargs)
|
||||
return wrapper
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ def order(request):
|
|||
consumption, _ = Consumption.objects.get_or_create(customer=user, product=product)
|
||||
consumption.quantity += quantity
|
||||
consumption.save()
|
||||
ch = ConsumptionHistory(customer = user, quantity = quantity, paymentMethod=paymentMethod, product=product, amount=int(quantity*product.amount), coopeman=request.user)
|
||||
ch = ConsumptionHistory(customer=user, quantity=quantity, paymentMethod=paymentMethod, product=product, amount=Decimal(quantity*product.amount), coopeman=request.user)
|
||||
ch.save()
|
||||
for m in menus:
|
||||
menu = get_object_or_404(Menu, pk=m["pk"])
|
||||
|
|
19
preferences/templates/preferences/inactive.html
Normal file
19
preferences/templates/preferences/inactive.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{% extends 'base.html' %}
|
||||
{% block entete %}Site inactif{% endblock %}
|
||||
{% block navbar %}
|
||||
<ul>
|
||||
<li><a href="#first">Site inactif</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<section id="first" class="main">
|
||||
<header class="major">
|
||||
<h2>Site inactif</h2>
|
||||
</header>
|
||||
<section>
|
||||
Le site coope.rez est actuellement inactif.<br>
|
||||
|
||||
<strong>Raison : {{message}}</strong>
|
||||
</section>
|
||||
</section>
|
||||
{% endblock %}
|
|
@ -13,4 +13,5 @@ urlpatterns = [
|
|||
path('addPaymentMethod', views.addPaymentMethod, name="addPaymentMethod"),
|
||||
path('editPaymentMethod/<int:pk>', views.editPaymentMethod, name="editPaymentMethod"),
|
||||
path('deletePaymentMethod/<int:pk>', views.deletePaymentMethod, name="deletePaymentMethod"),
|
||||
path('inactive', views.inactive, name="inactive"),
|
||||
]
|
||||
|
|
|
@ -229,3 +229,13 @@ def deletePaymentMethod(request,pk):
|
|||
paymentMethod.delete()
|
||||
messages.success(request, message)
|
||||
return redirect(reverse('preferences:paymentMethodsIndex'))
|
||||
|
||||
########## Active Site ##########
|
||||
|
||||
def inactive(request):
|
||||
"""
|
||||
Displays inactive view
|
||||
"""
|
||||
gp, _ = GeneralPreferences.objects.get_or_create(pk=1)
|
||||
return render(request, 'preferences/inactive.html', {"message": gp.active_message})
|
||||
|
|
@ -39,5 +39,5 @@
|
|||
<li><a href="https://www.facebook.com/coopesmetz/" class="icon fa-facebook alt"><span class="label">Facebook</span></a></li>
|
||||
</ul>
|
||||
</section>
|
||||
<p class="copyright">coope.rez v3.0 (release stable) © 2018 Yoann Pietri.</p>
|
||||
<p class="copyright">coope.rez v3.0.1 (release stable) © 2018 Yoann Pietri.</p>
|
||||
|
||||
|
|
Loading…
Reference in a new issue