On peut revendre une place qu'on a payée

This commit is contained in:
Ludovic Stephan 2020-10-29 11:13:39 +01:00 committed by Martin Pépin
parent f952d50b12
commit 411d7e7dce
No known key found for this signature in database
GPG key ID: E7520278B1774448
3 changed files with 1 additions and 13 deletions

View file

@ -77,7 +77,7 @@ class ResellForm(forms.Form):
super().__init__(*args, **kwargs)
self.fields["attributions"] = TemplateLabelField(
queryset=participant.attribution_set.filter(
spectacle__date__gte=timezone.now()
spectacle__date__gte=timezone.now(), paid=True
)
.exclude(revente__seller=participant)
.select_related("spectacle", "spectacle__location", "participant__user"),

View file

@ -1,6 +0,0 @@
{% extends "base_title.html" %}
{% block realcontent %}
<h2><strong>Nope</strong></h2>
<p>Avant de revendre des places, il faut aller les payer !</p>
{% endblock %}

View file

@ -385,12 +385,6 @@ def revente_manage(request, tirage_id):
user=request.user, tirage=tirage
)
# If the participant has just been created, the `paid` field is not
# automatically added by our custom ObjectManager. Skip the check in this
# scenario.
if not created and not participant.paid:
return render(request, "bda/revente/notpaid.html", {})
resellform = ResellForm(participant, prefix="resell")
annulform = AnnulForm(participant, prefix="annul")
soldform = SoldForm(participant, prefix="sold")