Commit graph

554 commits

Author SHA1 Message Date
Martin Pépin
ea737dab29 Merge branch 'Kerl/drop_py2_compat' of git.eleves.ens.fr:cof-geek/gestioCOF into Kerl/drop_py2_compat 2018-04-16 14:18:21 +02:00
Martin Pépin
a73736bf41 Merge branch 'master' into Kerl/drop_py2_compat 2018-04-16 14:12:36 +02:00
Ludovic Stephan
fc37c5a8a0 Annulation des reventes
- On peut annuler des reventes à tout point du processus
- Le formulaire d'annulation donne plus d'informations
2018-04-13 10:54:45 +02:00
Martin Pépin
6168045c3a bda: swap double/autoquit descriptions 2018-04-09 22:43:25 +02:00
Martin Pépin
87a6722143 Merge branch 'master' into Aufinal/bda_fixes 2018-04-07 14:46:07 +02:00
Martin Pépin
623047dca2 Fix old-style reversal of calendar urls 2018-04-06 11:11:02 +02:00
Martin Pepin
307c48ca76 Merge branch 'elarnon/fix-182' into 'master'
Properly propagate the default number of places in tirage

Closes #182

See merge request cof-geek/gestioCOF!295
2018-02-20 14:40:20 +01:00
Basile Clement
6ecc9a54b3 Properly propagate the default number of places in tirage
Fixes #182.
2018-02-11 19:24:01 +01:00
Basile Clement
3314670cab Various fixes for Django 1.11
- The {% cycle %} command was used non-quoted arguments separated by
   commas, while it is supposed to use quoted arguments separated by
   spaces (I'm actually not sure how that ever worked :)

 - django-bootstrap-form was at version 3.2.1 which is not compatible
   with Django 1.11 (but also required by GestioCOF). I upgraded it to
   version 3.3.
2018-02-11 19:09:07 +01:00
Martin Pépin
d57c75d2a0 Minor simplificatons after code review 2018-02-05 22:36:08 +01:00
Aurélien Delobelle
42e762bc4a Py3 allows to shorten super() 2018-01-16 16:50:27 +01:00
Martin Pépin
79fccc136a Merge branch 'master' into Kerl/tests 2018-01-10 20:21:38 +01:00
Ludovic Stephan
52fd49616d Fix model test 2018-01-10 20:14:27 +01:00
Martin Pépin
5a5b60ec4d Merge branch 'master' into Kerl/drop_py2_compat 2018-01-10 20:12:59 +01:00
Ludovic Stephan
501d592d2f Merge branch 'master' into Aufinal/bda_fixes 2018-01-10 20:00:34 +01:00
Martin Pepin
771b642a98 Merge branch 'aureplop/revente-reply_to' into 'master'
bda -- Set winner's email as Reply-to of the email…

Closes #179

See merge request !276
2018-01-07 16:03:20 +01:00
Martin Pépin
5086128f16 Fix ill-formed url in tests 2018-01-07 14:45:04 +01:00
Martin Pépin
c80e63415b Load custommails before bda tests 2018-01-07 14:30:33 +01:00
Martin Pépin
e9b901337e A few tests for BdA views 2018-01-07 13:35:23 +01:00
Martin Pépin
57411ab46f Remove __future__ imports 2018-01-06 16:10:13 +01:00
Martin Pépin
475f1adec5 Remove "coding: utf8" line 2018-01-06 16:10:13 +01:00
Ludovic Stephan
9a8773978c Use new method in admin 2017-12-19 12:50:20 +01:00
Ludovic Stephan
1783196a9c Management view only deals with Revente objects
Except for Revente creation, every form is now handled with revente
objects, to use the display option in the previous commit.
2017-12-19 12:41:50 +01:00
Ludovic Stephan
f1bbade002 Better labels for revente objects
The label for the ReventeModelMultipleChoiceField now depends on a
`own` parameter, which determines if we display the seller or the
buyer's name.
2017-12-19 12:40:50 +01:00
Ludovic Stephan
dfa8c1a1a1 Merge branch 'Aufinal/bda_fixes' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/bda_fixes 2017-12-19 11:54:07 +01:00
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
Martin Pépin
298015285a cleanup et nouvelle implem de custommail 2016-12-22 20:18:27 +01:00
Martin Pépin
5f29caec3c cleanup 2016-12-22 12:28:03 +01:00
Martin Pépin
b9c2efaf0e Merge branch 'master' into Kerl/use_django_custommail 2016-12-22 03:52:08 +01:00
Martin Pépin
fe8f18ff78 Utilise django_custommail
- On installe le package depuis le dépôt COF-Geek
- On supprime tous les fichiers texte des mails
- On charge dans la bdd les mails nécessaires au fonctionnement de
  GestioCOF
- On supprime le modèle CustomMail obsolète de gestioncof
2016-12-22 03:45:03 +01:00
Martin Pépin
847345bb63 Merge branch 'Aufinal/clean_code' into Kerl/clean_code_amend 2016-12-21 11:31:07 +01:00
Ludovic Stephan
2f70dbf911 default shotgun for existing rows 2016-12-21 01:05:04 -02:00
Ludovic Stephan
e8be072e78 message si inscription a une revente en cours 2016-12-21 00:53:35 -02:00
Ludovic Stephan
9bbc9e934d change soldTo functioning 2016-12-21 00:47:36 -02:00
Ludovic Stephan
38dd220c23 modernize reventes_shotgun 2016-12-21 00:35:05 -02:00
Martin Pépin
28df0355c2 Améliore l'algo d'inscription à une revente
Au lieu d'inscrire les gens à la première revente qu'on trouve on
les inscrit à celle qui a le moins de participants
2016-12-21 02:15:50 +01:00
Martin Pépin
330b45fb2c Style + commentaires 2016-12-20 22:24:07 +01:00
Ludovic Stephan
a9f25374ff Merge branch 'master' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/clean_code 2016-11-23 01:49:54 -02:00
Martin Pepin
d6dd7b346c Merge branch 'Elarnon/mail_bda' into 'master'
Améliore les mails automatiques du BdA

Les mails du BdA sont maintenant tous chargés depuis des templates gérés par le système de templates de Django, et plus par de l'interpolation de chaîne de caractères. Ceci permet en particulier d'utiliser (et de configurer) la localisation de Django afin d'afficher les dates de façon uniforme (et sans "hack" à la `date_no_seconds`) dans un format comportant un "à" entre le jour et l'heure.

See merge request !113
2016-11-20 16:53:29 +01:00
Martin Pépin
debc10213e Typo + docstrings inutiles 2016-11-20 16:52:07 +01:00
Martin Pépin
f93b095e0f Styling
Ou comment faire plaisir à pylint sur les bouts de code concernés
par cette MR
2016-11-20 16:39:26 +01:00
Ludovic Stephan
40f3cf60a0 code mort 2016-11-14 13:00:21 -02:00
Ludovic Stephan
fa3ddd099f Merge branch 'master' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/clean_code 2016-11-14 12:52:35 -02:00
Ludovic Stephan
b15dcba8c9 mail formatting 2016-11-14 12:52:16 -02:00
Ludovic Stephan
a63269a4ce more coherent names 2016-11-14 12:52:02 -02:00
Martin Pepin
b60365ddd6 Merge branch 'Aufinal/fix_reinit_past' into 'master'
Aufinal/fix reinit past

Rajoute quelques vérifications de date lors d'une réinitialisation

See merge request !110
2016-11-13 12:45:54 +01:00
Martin Pepin
2a4af5fcf4 Merge branch 'Elarnon/do_resell' into 'master'
Supprime do_resell

La fonction utilitaire `bda.views.do_resell` n’est plus utilisée
depuis la nouvelle version de bda-revente.

See merge request !111
2016-11-13 12:43:59 +01:00
Ludovic Stephan
790e73d7a4 fix messages revente_interested 2016-11-12 23:45:14 -02:00
Ludovic Stephan
1ba2766231 fix revente de reventes 2016-11-12 22:45:52 -02:00
Ludovic Stephan
13f282a289 Merge branch 'master' of https://git.eleves.ens.fr/cof-geek/gestioCOF into Aufinal/clean_code 2016-11-12 21:48:03 -02:00
Basile Clement
03f7dff813 Garde la locale par defaut dans les management commands 2016-11-12 11:09:40 +01:00