L'application `petitscours` reste assez fortement couplée à
`gestioncof`, et n'est pas (encore ?) faite pour être utilisée
séparément.
De façon similaire, et afin de minimiser de potentiels problèmes dûs à
des migrations, les modèles de l'application `petitscours` utilisent
`app_label = "gestioncof"` pour que Django les considère comme faisant
partie de l'application `"gestioncof"`. Ils pourront être migrés dans
un second temps si cela s'avère nécessaire.
Les changements sont nombreux, mais assez simples: il s'agit
principalement de déplacer des fichiers et changer des imports. J'ai
également profité de l'occasion pour réorganiser les templates afin de
les placer dans l'espace de nom "petitscours/".
cof/
* settings/common.py: Add `petitscours` app
* urls.py: Use `petitscours.urls`
petitscours/
* __init__.py: Added.
* tests/__init__.py: Added.
* tests/utils.py: Added.
* urls.py: Added.
gestioncof/
* admin.py:
* management/commands/loaddevdata.py:
* models.py:
* signals.py: Typo.
* urls.py:
Moved petitscours_patterns to petitscours.urls
* petits_cours_forms.py:
Moved to petitscours/forms.py
* petits_cours_models.py:
Moved to petitscours/models.py
* petits_cours_views.py:
Moved to petitscours/views.py
* tests/utils.py:
* tests/test_petitscours_views.py:
Moved to petitscours/tests/test_petitscours_views.py
* templates/base_title_petitscours.html:
Moved to petitscours/templates/petitscours/base_title.html
* templates/demande-petit-cours.html:
Moved topetitscours/templates/petitscours/demande.html
* templates/gestioncof/details_demande_petit_cours.html:
Moved to petitscours/templates/petitscours/demande_detail.html
* templates/petits_cours_demandes_list.html:
Moved to petitscours/templates/petitscours/demande_list.html
* templates/demande-petit-cours-raw.html:
Moved to petitscours/templates/petitscours/demande_raw.html
* templates/details_demande_petit_cours_infos.html:
Moved to petitscours/templates/petitscours/details_demande_infos.html
* templates/inscription-petit-cours.html:
Moved to petitscours/templates/petitscours/inscription.html
* templates/inscription-petit-cours-formset.html:
Moved to petitscours/templates/petitscours/inscription_formset.html
* templates/gestioncof/traitement_demande_petit_cours.html:
Moved to petitscours/templates/petitscours/traitement_demande.html
* templates/gestioncof/traitement_demande_petit_cours_autre_niveau.html:
Moved to petitscours/templates/petitscours/traitement_demande_autre_niveau.html
* templates/gestioncof/traitement_demande_petit_cours_success.html:
Moved to petitscours/templates/petitscours/traitement_demande_success.html
cas.eleves.ens.fr has /serviceValidate, not /p3/serviceValidate, and is
thus *probably* a V2 CAS server. python-cas was broken and using
/serviceValidate for V3 while it should have been /p3/serviceValidate,
see
c3ac4b6c76
reCAPTCHA v1 has been shut down since March 2018.
We now uses reCAPTCHA v2:
- user must check a simple checkbox (No CAPTCHA),
- eventually he must validate a challenge.
Moving keys settings allows to use the captcha for development.
Fixes#192.
- 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.
AccountBackend
- Should now work if used in AUTHENTICATION_BACKENDS settings.
- It does not retieve itself the password, as it should not be used
this way.
GenericBackend
- Delete useless 'username' arg of its 'authenticate()' method.
- Now delete the token in DB.
TemporaryAuthMiddleware
- New name of the middleware is more meaningful.
- Is now responsible to retrieve the password from the request, instead
of the AccountBackend.
GenericTeamToken model
- Add a manager' method to create token, avoiding possible error due to
unicity constraint.
GenericLoginView (authentication with the kfet generic user)
- Replace obscure system with a 100% HTTP handling.
- See comments for more information.
Misc
- More docstrings!
- More tests!
- Add some i18n.
- Add kfet/confirm_form.html template:
Ask user to confirm sth via a form (which will send a POST request).
Context variables:
* title: the page title
* confirm_url: action attribute for <form>
* text: displayed confirmation text
- kfet.js : Add functions allowing to emit POST request from <a> tag.
- Non-link nav items from kfet navbar also get a 'title'.
- A utility has been found for the 'sunglasses' glyphicon!
kfet.open app
- Base data (raw_open, last_update...) is stored and shared through cache system.
- 2 websockets groups: one for team users, one for other users.
- UI is initialized and kept up-to-date with WS.
- raw_open and force_close can be updated with standard HTTP requests.
At this time, there isn't any restriction on raw_open view. Common sense tell us
to change this behavior.
Misc
- Clean channels routing.
- 'PermConsumerMixin': user who sent the message is available as argument in
connection_groups method, which returns groups to which the user should be
appended on websocket connection (and discarded on disconnection).
- New kfet.utils module: should be used for mixins, whatever is useful and not concerns
the kfet app.
- Clean JS dependencies.
K-Fêt
- Integrate wagtail to serve "static" pages of old K-Fêt website
- Fixture "kfetcms/kfet_wagtail_17_05" contains a copy of old website
(as in May 2017).
- Media files can be got until end of June 17 at
http://partage.eleves.ens.fr//files/604e6dea2ceebc66b1936c6b3f911744/kfet_media.tar.gz
Login/logout
- Update package django_cas_ng to last version.
- Clean COFCASBackend.
- Change CAS version to 3 (version used on eleves.ens). This enables
the logout redirection (for CAS ofc).
- Add messages and clean existing ones on login/logout (for both
outsider and cas users).
Misc
- Update settings to bypass an incompability between debug-toolbar and
wagtailmenus packages.
- Better management of dev/test-specific urls (if debug-toolbar wasn't in
INSTALLED_APPS, media files were not served).
- UI improvements.
- Typo
- Removes old comments
- Moves the template debug context processor back to the common file: it
won't be loaded anyway if `DEBUG=False`.
- Ddt's middleware should be loaded first
We reproduce what has been done here:
https://github.com/dissemin/dissemin
The following files can be found under `cof/settings/`
- `common.py`: the settings that are shared by all the environments we
have + the secrets (see below).
- `dev.py`: the settings used by the vagrant VM for local development.
- `prod.py`: the production settings (for both www.cof.ens.fr and
dev.cof.ens.fr)
There is also a notion of "secrets". Some settings like the `SECRET_KEY`
or the database's credentials are loaded from an untracked files called
`secret.py` in the same directory. This secrets are loaded by the common
settings file.
- Cache use db #1 of redis.
- Channel layer (of channels) use db #0 of redis.
- `settings` try getting redis connection variables from environment.
- Drop memcached system
Old configuration(/settings), based on Settings model, system is
deleted: SettingsForm, Settings.
New system use `django-djconfig` module.
- `kfet.config` module provides `kfet_config` to access configuration concerning
kfet app.
- Views, forms, models, etc now use this object to retrieve conf values.
- Views no longer add config values to context, instead templates use
`kfet_config` provided by a new context_processor.
- Enhance list and update views of settings.
- Fix: settings can directly be used without having to visit a specific
page...
Misc
- Delete some py2/3 imports
- Delete unused imports in kfet.models and kfet.views
- Some PEP8 compliance
- 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
Virtualenv
Ce patch introduit un virtualenv dans le setup de dev. Cela permet notamment de passer à python 3 sans
avoir à remplacer toutes ses commandes `python manage.py ...` par `python3 manage.py ...`.
Il faut relancer le provisionning de la VM pour appliquer ce patch : `vagrant reload --provision`
See merge request !109
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
Configure la localisation (i10n) de Django afin d’afficher un format
plus user-friendly par défaut pour les dates (par exemple, afficher
"21 septembre 2016 à 15:00" plutôt que "21 septembre 2016
15:00"). Ceci permet d’éliminer les utilisations de `date_no_seconds`
pour simplement les remplacer par l’affichage de la date, le format
par défaut étant maintenant satisfaisant.
Attention : le bon fonctionnement de ceci nécessite de changer les
settings afin d’utiliser le module `cof.locale` comme module de
localisation (définir `FORMAT_MODULE_PATH = "cof.locale"`). Le module
`cof.locale` définit le format d’affichage des dates+heures
(`DATETIME_FORMAT`) afin d’incorporer le "à" qui n'est pas présent
dans la localisation française de Django.
- Suppression de la variable `ALLOWED_HOSTS` de `cof/settings.dev` de
sorte quand django utilise le default (qui est adapté à notre usage)
- Correction d'indentation
- Suppression d'un "-e" dans le fichier `requirements.txt`