mirror of
https://github.com/ae-utbm/sith.git
synced 2026-07-22 14:31:32 +00:00
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62e86f1043 | ||
|
|
79ec036b70 | ||
|
|
455b81cff6 | ||
|
|
9ceb51a54e | ||
|
|
790a1e15b1 | ||
|
|
b2ffcd3a37 | ||
|
|
ca37996d6a | ||
|
|
173311c1d5 | ||
|
|
2995823d6e |
@@ -886,28 +886,6 @@ class TestBarmanConnection(TestCase):
|
|||||||
)
|
)
|
||||||
assert response.status_code == 403
|
assert response.status_code == 403
|
||||||
|
|
||||||
def test_logout_then_login(self):
|
|
||||||
"""Test that the login is successful if it is after a previous logout.
|
|
||||||
|
|
||||||
This is a regression test for #1440
|
|
||||||
"""
|
|
||||||
self.client.post( # login
|
|
||||||
self.login_url, {"username": self.barman.username, "password": "plop"}
|
|
||||||
)
|
|
||||||
self.client.post( # logout
|
|
||||||
reverse("counter:logout", kwargs={"counter_id": self.counter.id}),
|
|
||||||
data={"user_id": self.barman.id},
|
|
||||||
)
|
|
||||||
response = self.client.post( # and re-login
|
|
||||||
self.login_url, {"username": self.barman.username, "password": "plop"}
|
|
||||||
)
|
|
||||||
assert response.status_code == 200
|
|
||||||
assert response.headers["HX-Redirect"] == self.detail_url
|
|
||||||
response = self.client.get(
|
|
||||||
self.detail_url, {"username": self.barman.username, "password": "plop"}
|
|
||||||
)
|
|
||||||
assert self.barman in response.wsgi_request.barmen
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_barman_timeout(client: Client):
|
def test_barman_timeout(client: Client):
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ class CounterLoginFragment(FragmentMixin, SingleObjectMixin, FormView):
|
|||||||
user = form.get_user()
|
user = form.get_user()
|
||||||
perm = self.object.permanencies.create(user=user, start=timezone.now())
|
perm = self.object.permanencies.create(user=user, start=timezone.now())
|
||||||
self.request.session.setdefault(SESSION_PERMANENCES_KEY, []).append(perm.id)
|
self.request.session.setdefault(SESSION_PERMANENCES_KEY, []).append(perm.id)
|
||||||
self.request.session.modified = True
|
|
||||||
self.success_url = reverse(
|
self.success_url = reverse(
|
||||||
"counter:details", kwargs={"counter_id": self.object.id}
|
"counter:details", kwargs={"counter_id": self.object.id}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -148,6 +148,56 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<section>
|
||||||
|
<div class="category-header">
|
||||||
|
<h3 class="margin-bottom">{% trans %}Eurockéennes 2025 partnership{% endtrans %}</h3>
|
||||||
|
{% if user.is_subscribed %}
|
||||||
|
<div id="eurock-partner" style="
|
||||||
|
min-height: 600px;
|
||||||
|
background-color: lightgrey;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
">
|
||||||
|
<p style="text-align: center;">
|
||||||
|
{% trans trimmed %}
|
||||||
|
Our partner uses Weezevent to sell tickets.
|
||||||
|
Weezevent may collect user info according to
|
||||||
|
its own privacy policy.
|
||||||
|
By clicking the accept button you consent to
|
||||||
|
their terms of services.
|
||||||
|
{% endtrans %}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<a href="https://weezevent.com/fr/politique-de-confidentialite/">{% trans %}Privacy policy{% endtrans %}</a>
|
||||||
|
|
||||||
|
<button
|
||||||
|
hx-get="{{ url("eboutic:eurock") }}"
|
||||||
|
hx-target="#eurock-partner"
|
||||||
|
hx-swap="outerHTML"
|
||||||
|
hx-trigger="click, load[document.cookie.includes('weezevent_accept=true')]"
|
||||||
|
@htmx:after-request="document.cookie = 'weezevent_accept=true'"
|
||||||
|
>{% trans %}Accept{% endtrans %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<p>
|
||||||
|
{%- trans trimmed %}
|
||||||
|
You must be subscribed to benefit from the partnership with the Eurockéennes.
|
||||||
|
{% endtrans -%}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{%- trans trimmed %}
|
||||||
|
This partnership offers a discount of up to 33%
|
||||||
|
on tickets for Friday, Saturday and Sunday,
|
||||||
|
as well as the 3-day package from Friday to Sunday.
|
||||||
|
{% endtrans -%}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
{% for prices in categories %}
|
{% for prices in categories %}
|
||||||
{% set category = prices[0].product.product_type %}
|
{% set category = prices[0].product.product_type %}
|
||||||
<section>
|
<section>
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<a title="Logiciel billetterie en ligne"
|
||||||
|
href="https://www.weezevent.com?c=sys_widget"
|
||||||
|
class="weezevent-widget-integration"
|
||||||
|
target="_blank"
|
||||||
|
data-src="https://widget.weezevent.com/ticket/8aaba226-f7a3-4192-a64e-72ff8f5b35b7?id_evenement=1419869&locale=fr-FR&code=28747"
|
||||||
|
data-width="650"
|
||||||
|
data-height="600"
|
||||||
|
data-resize="1"
|
||||||
|
data-nopb="0"
|
||||||
|
data-type="neo"
|
||||||
|
data-width_auto="1"
|
||||||
|
data-noscroll="0"
|
||||||
|
data-id="1419869">
|
||||||
|
Billetterie Weezevent
|
||||||
|
</a>
|
||||||
|
<script type="text/javascript" src="https://widget.weezevent.com/weez.js" async defer></script>
|
||||||
@@ -31,6 +31,7 @@ from eboutic.views import (
|
|||||||
EbouticMainView,
|
EbouticMainView,
|
||||||
EbouticPayWithSith,
|
EbouticPayWithSith,
|
||||||
EtransactionAutoAnswer,
|
EtransactionAutoAnswer,
|
||||||
|
EurockPartnerFragment,
|
||||||
payment_result,
|
payment_result,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -50,4 +51,5 @@ urlpatterns = [
|
|||||||
EtransactionAutoAnswer.as_view(),
|
EtransactionAutoAnswer.as_view(),
|
||||||
name="etransation_autoanswer",
|
name="etransation_autoanswer",
|
||||||
),
|
),
|
||||||
|
path("eurock/", EurockPartnerFragment.as_view(), name="eurock"),
|
||||||
]
|
]
|
||||||
|
|||||||
+6
-2
@@ -43,11 +43,11 @@ from django.utils.formats import localize
|
|||||||
from django.utils.timezone import localtime
|
from django.utils.timezone import localtime
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.views.decorators.http import require_GET
|
from django.views.decorators.http import require_GET
|
||||||
from django.views.generic import DetailView, FormView, UpdateView, View
|
from django.views.generic import DetailView, FormView, TemplateView, UpdateView, View
|
||||||
from django.views.generic.edit import SingleObjectMixin
|
from django.views.generic.edit import SingleObjectMixin
|
||||||
from django_countries.fields import Country
|
from django_countries.fields import Country
|
||||||
|
|
||||||
from core.auth.mixins import CanViewMixin
|
from core.auth.mixins import CanViewMixin, IsSubscriberMixin
|
||||||
from core.views.mixins import FragmentMixin, UseFragmentsMixin
|
from core.views.mixins import FragmentMixin, UseFragmentsMixin
|
||||||
from counter.forms import BaseBasketForm, BasketItemForm, BillingInfoForm
|
from counter.forms import BaseBasketForm, BasketItemForm, BillingInfoForm
|
||||||
from counter.models import (
|
from counter.models import (
|
||||||
@@ -359,3 +359,7 @@ class EtransactionAutoAnswer(View):
|
|||||||
return HttpResponse(
|
return HttpResponse(
|
||||||
"Payment failed with error: " + request.GET["Error"], status=202
|
"Payment failed with error: " + request.GET["Error"], status=202
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class EurockPartnerFragment(IsSubscriberMixin, TemplateView):
|
||||||
|
template_name = "eboutic/eurock_fragment.jinja"
|
||||||
|
|||||||
@@ -4465,6 +4465,47 @@ msgstr ""
|
|||||||
msgid "this page"
|
msgid "this page"
|
||||||
msgstr "cette page"
|
msgstr "cette page"
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
msgid "Eurockéennes 2025 partnership"
|
||||||
|
msgstr "Partenariat Eurockéennes 2025"
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
msgid ""
|
||||||
|
"Our partner uses Weezevent to sell tickets. Weezevent may collect user info "
|
||||||
|
"according to its own privacy policy. By clicking the accept button you "
|
||||||
|
"consent to their terms of services."
|
||||||
|
msgstr ""
|
||||||
|
"Notre partenaire utilises Wezevent pour vendre ses billets. Weezevent peut "
|
||||||
|
"collecter des informations utilisateur conformément à sa propre politique de "
|
||||||
|
"confidentialité. En cliquant sur le bouton d'acceptation vous consentez à "
|
||||||
|
"leurs termes de service."
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
msgid "Privacy policy"
|
||||||
|
msgstr "Politique de confidentialité"
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
#: trombi/templates/trombi/comment_moderation.jinja
|
||||||
|
msgid "Accept"
|
||||||
|
msgstr "Accepter"
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
msgid ""
|
||||||
|
"You must be subscribed to benefit from the partnership with the Eurockéennes."
|
||||||
|
msgstr ""
|
||||||
|
"Vous devez être cotisant pour bénéficier du partenariat avec les "
|
||||||
|
"Eurockéennes."
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"This partnership offers a discount of up to 33%% on tickets for Friday, "
|
||||||
|
"Saturday and Sunday, as well as the 3-day package from Friday to Sunday."
|
||||||
|
msgstr ""
|
||||||
|
"Ce partenariat permet de profiter d'une réduction jusqu'à 33%% sur les "
|
||||||
|
"billets du vendredi, du samedi et du dimanche, ainsi qu'au forfait 3 jours, "
|
||||||
|
"du vendredi au dimanche."
|
||||||
|
|
||||||
#: eboutic/templates/eboutic/eboutic_main.jinja
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
msgid "Product sold out"
|
msgid "Product sold out"
|
||||||
msgstr "Produit épuisé"
|
msgstr "Produit épuisé"
|
||||||
@@ -5908,10 +5949,6 @@ msgstr "fin"
|
|||||||
msgid "Moderate Trombi comments"
|
msgid "Moderate Trombi comments"
|
||||||
msgstr "Modérer les commentaires du Trombi"
|
msgstr "Modérer les commentaires du Trombi"
|
||||||
|
|
||||||
#: trombi/templates/trombi/comment_moderation.jinja
|
|
||||||
msgid "Accept"
|
|
||||||
msgstr "Accepter"
|
|
||||||
|
|
||||||
#: trombi/templates/trombi/comment_moderation.jinja
|
#: trombi/templates/trombi/comment_moderation.jinja
|
||||||
msgid "Reject"
|
msgid "Reject"
|
||||||
msgstr "Refuser"
|
msgstr "Refuser"
|
||||||
|
|||||||
Generated
+3
-3
@@ -2678,9 +2678,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/brace-expansion": {
|
"node_modules/brace-expansion": {
|
||||||
"version": "5.0.6",
|
"version": "5.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
|
||||||
"integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",
|
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"balanced-match": "^4.0.2"
|
"balanced-match": "^4.0.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user