Commit graph

479 commits

Author SHA1 Message Date
Ludovic Stephan
212528011a Add some tests 2017-12-19 11:40:02 +01:00
Aurélien Delobelle
241c77e3b4 bda -- Set winner's email as Reply-to of the email…
…sent to the seller when a resale has been assigned.

Fixes #179.
2017-11-24 06:58:33 +01:00
Aurélien Delobelle
b0b0542407 Upgrade to Django 1.11
- Deprecation warnings using Django 1.8 are resolved.
- Deprecation warnings using Django 1.11 are resolved.

- Admin: grappelli is no longer used.
- Upgrade to django-autocomplete-light v3 (v2 is not 1.11 compatible).
  * autocomplete.modelform_factory being dropped, code uses dal Select2
    views and widgets.
2017-11-19 18:41:39 +01:00
Martin Pépin
91bdf11852 Coding style: python's scope sucks 2017-11-01 17:29:38 +01:00
Martin Pépin
f18959c0a1 BdA-Revente: meaningful names, some help tests 2017-11-01 17:26:40 +01:00
Martin Pépin
e1794a654f Merge branch 'master' into Aufinal/bda_fixes 2017-11-01 11:25:52 +01:00
Martin Pépin
273e6374ef Pluralization in bda -> participant list 2017-11-01 11:09:35 +01:00
Ludovic Stephan
785555c05c Misc fixes 2017-10-26 12:40:11 +02:00
Aurélien Delobelle
8cdb4c62fc Merge branch 'master' into test/views 2017-10-24 16:45:26 +02:00
Ludovic Stephan
6a6549e0d7 Add notif time
In case of a gestioCOF bug, we keep the notification time in memory to
still do the drawing 1-3 days after.
2017-10-23 20:55:01 +02:00
Ludovic Stephan
684603709e Class attributes and properties + more verbose log
SpectacleRevente gets brand new properties and attributes to simplify
code ; also, manage_reventes command output is more verbose
2017-10-23 20:30:34 +02:00
Ludovic Stephan
919bcd197d Small code QoL improvements 2017-10-23 18:59:30 +02:00
Ludovic Stephan
e74dbb11f1 Organize revente files and function names 2017-10-23 18:39:45 +02:00
Ludovic Stephan
732e47707e Add unsubscribe option + list of current draws 2017-10-23 17:25:58 +02:00
Aurélien Delobelle
46187659ed Fix tirage pk conflicts with postgres 2017-10-17 14:42:39 +02:00
Martin Pépin
b73faa3b84 Merge branch 'master' into Production 2017-09-25 18:40:00 +02:00
Aurélien Delobelle
d18fb86a98 Fix attribution inlines of participant in admin 2017-09-25 18:26:54 +02:00
Martin Pépin
db512a97f6 In /admin: displays "given" when it's relevant 2017-09-25 14:22:46 +02:00
Martin Pépin
d89ba1efe5 Fix catalogue behaviour if id=0 2017-09-20 18:21:59 +02:00
Martin Pépin
80f6a808dc Simplify the mails-rappel view 2017-06-18 17:03:50 +01:00
Martin Pépin
69aee6b8ac Move bda.get_generic_user + optimize send_rappels 2017-06-18 16:52:53 +01:00
Martin Pépin
5c11893059 Add a link to the "bda-rappel" mail edition page 2017-06-02 19:33:23 +01:00
Martin Pépin
4fce1e8afc typo 2017-06-02 19:14:10 +01:00
Martin Pépin
ffb777a4cd Test the "participants" views 2017-06-02 19:14:10 +01:00
Martin Pépin
76c75d5ccd Move bda-participant template -> bda/ folder 2017-06-02 19:14:10 +01:00
Martin Pépin
fbdfdeef46 Add a link to the reminder emails sending page 2017-06-02 19:14:09 +01:00
Martin Pépin
31c034a96a send_rappel: use django messages + css tweaks 2017-06-02 19:14:06 +01:00
Martin Pépin
2a3614540f minor PEP8 changes 2017-06-02 17:32:23 +01:00
Martin Pépin
0e03fc85ee The BdA receives the reminder emails 2017-06-02 17:25:04 +01:00
Aurélien Delobelle
6cdb791989 fix class name conflicts 2017-05-10 12:39:56 +02:00
Aurélien Delobelle
0d8a613f28 improve bda inscription form/view code 2017-04-21 18:22:53 +02:00
Aurélien Delobelle
ce70269e7b Fewer requests on create/update spectaclerevente in bda admin.
- O(#participant) -> O(1) requests
2017-04-08 17:50:36 +02:00
Aurélien Delobelle
0750551d7c Fewer requests on participant admin create and updateviews.
- Fewer requests on choicesreventes and tabular inlines (of
  attributions)
- User and tirage cannot be updated if updating a participant instance.
- Tabular inlines are fixed:
  - the one which is used for spectacles with listing only propose
    choices in spectacle with listing
  - same with the other (spectacles without listing)
- Still does too much request (because of tabularinlines)
2017-04-08 17:16:33 +02:00
Aurélien Delobelle
6451f971bd AttributionForm in bda admin
- New attribution form issue less queries
- Spectacle and Participant are readonly if updating an attribution.

ReadOnlyMixin allows to set readonly fields only while updating an
object.
2017-04-08 16:11:42 +02:00
Aurélien Delobelle
bbe6f41962 Fewer requests on descriptions and catalogue views 2017-04-08 13:44:21 +02:00
Aurélien Delobelle
98f355ed20 Fewer requests on unpaid view 2017-04-08 13:08:53 +02:00
Aurélien Delobelle
15d2faf8e1 Fewer requests on spectacles and participants list views 2017-04-08 13:01:05 +02:00
Aurélien Delobelle
93a3a9af2c Fewer requests with shotgunable reventes
bda.views.revente_shotgun:
- 2 requests instead of ~#spectacles requests
2017-04-08 12:53:37 +02:00
Aurélien Delobelle
fdc1128bd5 delete useless save 2017-04-08 12:12:56 +02:00
Aurélien Delobelle
3556e3b1b0 Fewer requests on bda.views.revente 2017-04-08 12:10:23 +02:00
Aurélien Delobelle
d31101aff3 Empty SpectacleRevente and ChoixRevente before do_tirage.
- Usefull if a tirage is launched more than once.
- Ensure full reset of reventes for this tirage in this case.
2017-04-07 17:04:06 +02:00
Aurélien Delobelle
9f307c1bd0 Fewer db requests on bda tirage.
bda.algorithm
- use iterator to find max_groups, instead of a db request

bda.views.do_tirage
- select_related() are now focused on some relationships (they were
  taking useless relationships)
- bda-revente filling takes 1 request (each save and add was issuing
  1 request)
2017-04-07 16:22:10 +02:00
Aurélien Delobelle
3e0bd2e758 Fewer db requests on bda views.
bda.views.etat_places
- Use select_related on spectacles_set,  avoid query issue for each spectacle.
- `slots__sum` is computed in view, instead of a query.
- Cleaner code (and avoid useless computations).

bda.views.places
- Add select_related on places, avoid query issue for each spectacle.

bda.views.inscription
- 1 query for spectacle field choices, instead of (#forms in formset *
  #spectacles)
- Delete BaseBdaFormSet. The validation was redundant with
  `unique_together` of ChoixSpectacle model.
2017-04-07 13:25:50 +02:00
Martin Pépin
981759f5ce Adds tests covering the bda-catalogue JSON API 2017-04-05 21:02:00 +01:00
Martin Pépin
9ec151e040 A query optimization in bda.views.catalogue
We only need to fetch shows identifiers here:

    FOO.filter(BAR__in=shows)

which can be done using the `values_list` method
2017-04-05 20:48:18 +01:00
Martin Pépin
ff9cee5ffc line too long in bda.models 2017-04-05 20:42:50 +01:00
Martin Pépin
853a239e6e Rewrite bda.views.catalogue
- No string concatenations
- Use `get_object_or_404` instead of performing a `.get` and catching
  the eventual exception.
- More accurate error messages when a bad request is detected.
- More accurate error handling
2017-04-05 19:53:04 +01:00
Martin Pépin
a262983170 PEP8 compliance in bda.views 2017-04-04 23:51:22 +01:00
Martin Pepin
1eed2283f5 Merge branch 'Roussille/bda' into 'master'
Catalogue BdA

See merge request !187
2017-04-01 18:56:26 +02:00
Hugo Roussille
66dd7848b8 Correction du format de l'URL 2017-04-01 16:48:18 +02:00
Hugo Roussille
6b8001db56 Correction des messages d'erreur et de la gestion des exceptions 2017-04-01 16:34:17 +02:00
Martin Pépin
67b4421933 PEP8 does not like \ 2017-03-31 17:54:31 +01:00
Martin Pépin
8a1af73ee0 A migration for the new field appear_catalogue 2017-03-31 17:53:35 +01:00
Hugo Roussille
8cf14d3f6b Possibilité de filtrer sur plusieurs salles/catégories 2017-03-31 04:33:13 +02:00
Hugo Roussille
73c21d83ee Correction des exceptions et de l'URL des images 2017-03-31 03:47:32 +02:00
Hugo Roussille
f3b9266e35 Simplification du code avec des méthodes de Django 2017-03-31 03:35:09 +02:00
Hugo Roussille
a9c8de7544 Utilisation des JsonResponse 2017-03-31 03:15:40 +02:00
Hugo Roussille
c4a3c1a92a Formatage du code selon PEP-8 2017-03-31 02:51:58 +02:00
Martin Pépin
2d22c202e9 Prevent side effects while sending emails 2017-03-29 18:17:20 +01:00
Hugo Roussille
a8428f1b41 Précision des tirages qui doivent apparaître dans le catalogue 2017-03-16 06:34:49 +01:00
Hugo Roussille
7ecea0e391 Meilleure gestion des dates et timezones 2017-03-16 06:22:01 +01:00
Hugo Roussille
68334e15d7 Gestion des citations 2017-03-16 05:50:02 +01:00
Hugo Roussille
f64a865de1 Côté serveur du catalogue des spectacles BdA 2017-03-15 07:37:24 +01:00
Ludovic Stephan
42a93027d3 fix pep8 + move template 2017-02-21 19:49:29 -03:00
Ludovic Stephan
d96f4ead87 Revert "remove immediate mail"
This reverts commit 8953d3de07.
2017-02-16 09:55:19 -02:00
Ludovic Stephan
8953d3de07 remove immediate mail 2017-02-16 09:22:15 -02:00
Ludovic Stephan
d524d9286f better annulation check 2017-02-16 02:28:57 -02:00
Ludovic Stephan
d9402e1059 change resell and reinit forms 2017-02-16 01:52:44 -02:00
Martin Pépin
427859c2f5 Oublis 2017-02-11 21:33:25 +01:00
Martin Pépin
70e89e3737 Merge branch 'master' into Kerl/messages 2017-02-11 20:55:17 +01:00
Martin Pépin
65341f0ecb Minor error 2017-02-11 20:43:49 +01:00
Martin Pépin
27bf59d4c0 Merge branch 'Kerl/use_django_custommail' of git.eleves.ens.fr:cof-geek/gestioCOF into Kerl/use_django_custommail 2017-02-11 16:16:00 +01:00
Martin Pépin
b4bf437447 Minor fixes 2017-02-11 16:15:17 +01:00
Qwann
5d35112c87 Merge branch 'Kerl/use_django_custommail' of git.eleves.ens.fr:cof-geek/gestioCOF into Kerl/use_django_custommail 2017-02-11 15:34:04 +01:00
Qwann
62dc04c19f cleaning ugly html 2017-02-11 15:33:22 +01:00
Martin Pépin
675ff99414 Supprime les doublons avec jquery 2017-02-11 11:50:49 +01:00
Martin Pépin
71fb020e10 Merge branch 'master' into Kerl/messages 2017-02-11 11:40:47 +01:00
Martin Pépin
6e55905781 Merge branch 'master' into Kerl/use_django_custommail 2017-02-11 03:20:29 +01:00
Evarin
839d60e48f Support tactile jquery-ui 2017-02-11 00:11:14 +01:00
Evarin
80d8cb6b7e Mise à jour des dépendances jquery-ui et jquery
Should fix #80 - à tester sur mobile (via dev.cof)
2017-02-10 23:47:49 +01:00
Evarin
f7ec5ef9ee Grise les spectacles passés dans la liste des spectacles pour le BdA 2017-02-10 19:58:22 +01:00
Martin Pépin
f274c1e978 Un seul message pour la liste des inscriptions 2017-02-04 00:01:15 +01:00
Martin Pépin
b12b5c938f Proper use of messages in inscription-reventes 2017-02-03 18:29:12 +01:00
Martin Pépin
efea92b5d2 Proper use of messages in places 2017-02-03 18:29:11 +01:00
Martin Pépin
91fff8a11e Proper use of messages in BdA inscription 2017-02-03 18:29:05 +01:00
Martin Pépin
d31b9f59ab Traitement des messages
- Les messages sont affichés à l'utilisateurs dans les vues de GestioCOF
- On utilise une autre version de bootstrap et jquery (plus récent)

Fixes #48
2017-02-03 18:28:56 +01:00
Martin Pépin
ba88b94320 Fixes and cleanup 2017-02-03 17:07:50 +01:00
Martin Pépin
18b186929c Dev data loaded using a django admin command
- Sites, surveys, events and petits cours demands/subjects are still
  loaded from fixtures
- The users and their subscriptions to petits cours are loaded using the
  `loaddevdata` command
- The sub command `loadbdadevdata` is called by `loaddevdata` and
  populates the database with BdA related stuff :
  - 2 tirages
  - Show places
  - Shows
  - subscriptions
2017-02-03 14:33:10 +01:00
Martin Pepin
c2b74ea625 Merge branch 'Kerl/bda_models_update' into 'master'
Typo et suppression de la py2 compat



See merge request !150
2017-01-25 23:58:23 +01:00
Qwann
30cebac6e6 Merge branch 'hotfix/bda-static' 2017-01-24 20:39:14 +01:00
Martin Pépin
045f3f58e5 Met inscription-formset àa la bonne place 2017-01-24 20:34:53 +01:00
Martin Pépin
993b8ae87b Merge branch 'master' into Kerl/use_django_custommail 2017-01-13 01:02:01 +01:00
Martin Pépin
3e96c982f9 Fix urls in production 2017-01-10 23:07:27 +01:00
Martin Pépin
1b82b2300a Typo et suppression de la py2 compat 2017-01-08 20:26:02 +01:00
Martin Pépin
3f9f19ef8c Hotfix pour le JS absent
C'est un workaround, j'ai juste ajouté les fichiers JS absent dans
`bda/static/bda/js/`. Ces fichiers sont un peu outdated et le code
mériterait peut-être une modernisation mais au moins on peu s'inscrire
au tirage sans problème.

Fixes #124
2017-01-08 19:55:35 +01:00
Martin Pépin
dc33160e0b Plus d'infos + pluralisation
Sur la page des ratios par spectacle
2017-01-07 13:13:12 +01:00
Martin Pépin
4f66f161b0 Rend la page état des demandes/ratios cohérente
- Le nombre total de demandes affiché est désormais le nombre de places
  demandées et non le nombre de personnes ayant fait des demandes. Ainsi
  ce nombre correspond à la somme des totaux par spectacle affiché

- Au passage, on déplace le template de cette vue dans un dossier plus
  adéquat et on ajoute une docstring sur la vue.
2017-01-06 18:19:15 +01:00
Martin Pépin
a5b6901972 Merge branch 'Kerl/use_django_custommail' of git.eleves.ens.fr:cof-geek/gestioCOF into Kerl/use_django_custommail 2016-12-23 16:08:41 +01:00
Martin Pépin
8bf2f715a4 Correction de bugs et nettoyage 2016-12-23 15:49:03 +01:00
Martin Pépin
b39806e171 Migration et chargement des emails
- La migration qui supprime le vieux modèle gestioncof.CustomMail est
  ajoutée
- Les mails de GestioCOF sont dans un json qui est chargé par la commande
  `python manage.py syncmails`
  Voir l'aide de la commande pour plus 'information
2016-12-23 15:48:57 +01:00