forked from DGNum/gestioCOF
suppression fonctions inutiles
This commit is contained in:
parent
929e70f5d3
commit
8e8c9a173a
2 changed files with 0 additions and 45 deletions
40
bda/views.py
40
bda/views.py
|
@ -320,46 +320,6 @@ def spectacle(request, tirage_id, spectacle_id):
|
||||||
return render(request, "bda-participants.html",
|
return render(request, "bda-participants.html",
|
||||||
{"spectacle": spectacle, "participants": participants_info})
|
{"spectacle": spectacle, "participants": participants_info})
|
||||||
|
|
||||||
@buro_required
|
|
||||||
@require_POST
|
|
||||||
def add_attrib(request, tirage_id, spectacle_id):
|
|
||||||
tirage = get_object_or_404(Tirage, id=tirage_id)
|
|
||||||
spectacle = get_object_or_404(Spectacle, id=spectacle_id, tirage=tirage)
|
|
||||||
try:
|
|
||||||
part=tirage.participant_set.get(user__username=request.POST['username'])
|
|
||||||
except Participant.DoesNotExist:
|
|
||||||
messages.add_message(request, messages.ERROR,
|
|
||||||
u"Erreur : utilisateur %s non trouvé" % request.POST['username'])
|
|
||||||
return HttpResponseRedirect(reverse('bda-spectacle',
|
|
||||||
args=(tirage_id, spectacle_id,)))
|
|
||||||
|
|
||||||
attrib = Attribution(participant=part, spectacle=spectacle,
|
|
||||||
given=('given' in request.POST))
|
|
||||||
attrib.save()
|
|
||||||
if int(request.POST['nb_places'])==2:
|
|
||||||
attrib2 = Attribution(participant=part, spectacle=spectacle,
|
|
||||||
given=('given' in request.POST))
|
|
||||||
attrib2.save()
|
|
||||||
|
|
||||||
messages.add_message(request, messages.SUCCESS,
|
|
||||||
"Attribution réussie !")
|
|
||||||
return HttpResponseRedirect(reverse('bda-spectacle',
|
|
||||||
args=(tirage_id, spectacle_id,)))
|
|
||||||
|
|
||||||
@buro_required
|
|
||||||
@require_POST
|
|
||||||
def del_attrib(request, tirage_id, spectacle_id):
|
|
||||||
tirage = get_object_or_404(Tirage, id=tirage_id)
|
|
||||||
spectacle = get_object_or_404(Spectacle, id=spectacle_id, tirage=tirage)
|
|
||||||
part = tirage.participant_set.get(user__username=request.POST['username'])
|
|
||||||
spectacle.attribues.filter(participant=part).delete()
|
|
||||||
|
|
||||||
|
|
||||||
messages.add_message(request, messages.SUCCESS,
|
|
||||||
"Attribution(s) supprimée(s) !")
|
|
||||||
return HttpResponseRedirect(reverse('bda-spectacle',
|
|
||||||
args=(tirage_id, spectacle_id,)))
|
|
||||||
|
|
||||||
class SpectacleListView(ListView):
|
class SpectacleListView(ListView):
|
||||||
model = Spectacle
|
model = Spectacle
|
||||||
template_name = 'spectacle_list.html'
|
template_name = 'spectacle_list.html'
|
||||||
|
|
|
@ -601,11 +601,6 @@ pre code {
|
||||||
|
|
||||||
.etat-bda tr:nth-child(even) {background: #CCC}
|
.etat-bda tr:nth-child(even) {background: #CCC}
|
||||||
|
|
||||||
#bda-part-button {
|
|
||||||
border:none;
|
|
||||||
background-color:#eee
|
|
||||||
}
|
|
||||||
|
|
||||||
.greenratio {
|
.greenratio {
|
||||||
background-color: #3F3;
|
background-color: #3F3;
|
||||||
border: 5px solid #ccc;
|
border: 5px solid #ccc;
|
||||||
|
|
Loading…
Reference in a new issue