forked from DGNum/gestioCOF
Merge branch 'Aufinal/can_resell_paid' into 'master'
On peut revendre une place dès qu'on l'a payée Closes #277 See merge request klub-dev-ens/gestioCOF!473
This commit is contained in:
commit
479e751b7c
4 changed files with 5 additions and 15 deletions
|
@ -23,8 +23,10 @@ adhérents ni des cotisations.
|
|||
|
||||
## Version ??? - dans un futur proche
|
||||
|
||||
### COF
|
||||
### COF / BdA
|
||||
|
||||
- On peut revendre une place dès qu'on l'a payée, plus besoin de payer toutes
|
||||
ses places pour pouvoir revendre.
|
||||
- On s'assure que les emails dans les demandes de petits cours sont valides.
|
||||
|
||||
### K-Fêt
|
||||
|
|
|
@ -3,7 +3,7 @@ from django.forms.models import BaseInlineFormSet
|
|||
from django.template import loader
|
||||
from django.utils import timezone
|
||||
|
||||
from bda.models import Attribution, Spectacle, SpectacleRevente
|
||||
from bda.models import SpectacleRevente
|
||||
|
||||
|
||||
class InscriptionInlineFormSet(BaseInlineFormSet):
|
||||
|
@ -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"),
|
||||
|
|
|
@ -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 %}
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue