Merge branch 'master' of https://git.eleves.ens.fr/cof-geek/gestioCOF into Aufinal/view_spectacles

This commit is contained in:
ludo 2016-06-12 16:03:55 +02:00
commit d424089a55
18 changed files with 165 additions and 89 deletions

View file

@ -1,10 +1,10 @@
# coding: utf-8
from django.contrib.auth.models import User
from __future__ import division
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.db import models
from django.http import Http404
from django.core import serializers
from django.forms.models import inlineformset_factory
import hashlib
@ -17,7 +17,6 @@ from datetime import timedelta
import time
from gestioncof.decorators import cof_required, buro_required
from gestioncof.shared import send_custom_mail
from bda.models import Spectacle, Participant, ChoixSpectacle, Attribution, Tirage
from bda.algorithm import Algorithm
@ -49,13 +48,13 @@ def etat_places(request, tirage_id):
spectacles_dict[spectacle["spectacle"]].total += spectacle["total"]
spectacles_dict[spectacle["spectacle"]].ratio = \
spectacles_dict[spectacle["spectacle"]].total / \
float(spectacles_dict[spectacle["spectacle"]].slots)
spectacles_dict[spectacle["spectacle"]].slots
total += spectacle["total"]
for spectacle in spectacles2:
spectacles_dict[spectacle["spectacle"]].total += 2*spectacle["total"]
spectacles_dict[spectacle["spectacle"]].ratio = \
spectacles_dict[spectacle["spectacle"]].total / \
float(spectacles_dict[spectacle["spectacle"]].slots)
spectacles_dict[spectacle["spectacle"]].slots
total += spectacle["total"]
return render(request, "etat-places.html",
{"spectacles": spectacles, "total": total, 'tirage': tirage})
@ -118,7 +117,6 @@ def places_ics(request, tirage_id):
places_dict[place.spectacle] = place
spectacles.append(place.spectacle)
filtered_places.append(place)
date = place.spectacle.date.date()
return render(request, "resume_places.ics",
{"participant": participant,
"places": filtered_places}, content_type="text/calendar")
@ -262,18 +260,6 @@ def do_resell(request, form):
spectacle = form.cleaned_data["spectacle"]
count = form.cleaned_data["count"]
places = "2 places" if count == "2" else "une place"
"""
send_custom_mail("bda-revente@lists.ens.fr",
"bda-revente",
{"places": places,
"spectacle": spectacle.title,
"date": spectacle.date_no_seconds(),
"lieu": spectacle.location,
"prix": spectacle.price,
"revendeur": request.user.get_full_name(),
"revendeur_mail": request.user.email},
from_email = request.user.email)
"""
mail = u"""Bonjour,
Je souhaite revendre %s pour %s le %s (%s) à %.02f.