Commit graph

72 commits

Author SHA1 Message Date
Ludovic Stephan
be5218f7e1 Remove pesky middleware 2019-11-21 01:21:26 +01:00
Ludovic Stephan
4a4dae9951 Merge branch 'kerl/clubs' into 'master'
Nouvelle app: clubs

See merge request klub-dev-ens/gestioCOF!372
2019-11-06 19:22:58 +01:00
Ludovic Stephan
898abd15c6 Ignore /src directories 2019-10-16 20:51:10 +02:00
Ludovic Stephan
64b4c2c08a Revert "Ignore src/ directories"
On ignorera ça proprement en Django 2.2...
2019-10-16 20:27:57 +02:00
Ludovic Stephan
8a6a3d0994 Ignore src/ directories 2019-10-16 20:27:57 +02:00
Martin Pépin
380e38519b
New app: clubs
- Clubs will be used both by the cof and the bds app.
- For now, they are only visible in development.
2019-10-16 19:58:12 +02:00
Martin Pépin
f9aee86a1c
Only enable the bds app in development 2019-10-15 21:54:52 +02:00
Ludovic Stephan
b3e7b59903
Migrations
Une migration pour les modèles, et une pour créer le groupe du Burô du
BDS
2019-10-15 21:51:40 +02:00
Martin Pépin
8119591c62
enable the "events" app in CI 2019-10-06 19:24:32 +02:00
Martin Pépin
34e552f760
New 'events' app, first model
The objective is to move (at some point) all the management logic in
this app. Before that time: as long as the events app does not have all
the features necessary to be used in production it is only available in
dev mode and coexists with the old event system. When it's ready we'll
move the old events in the new app (data migration) and remove the old
system.
2019-10-06 19:24:32 +02:00
Ludovic Stephan
759b6d9489 Update settings ; remove debug_panel 2019-04-12 17:04:33 +02:00
Ludovic Stephan
fd0f387dbc Merge branch 'Kerl/DJANGO_NO_DDT' into 'master'
Une variable d'environement pour désactiver la django debug toolbar

See merge request klub-dev-ens/gestioCOF!353
2019-03-19 17:59:39 +01:00
Martin Pépin
fabb30cec2 add a DJANGO_NO_DDT env variable to disable ddt 2019-02-12 17:55:23 +01:00
Evarin
641bdd9464 Plus besoin de ça 2019-02-11 21:26:16 +01:00
Evarin
0f1e05acdd Migration vers Wagtail 2.3 et Wagtail-modeltranslation 0.9
Toutes les pages Wagtail doivent désormais être traduites
Suppression du modèle COFUtilPage devenu inutile
Réinitialisation des migrations de Wagtail à cause des changements de ModelTranslation
2019-02-04 22:56:48 +01:00
Martin Pepin
512868ee14 Merge branch 'evarin/site-cof' into 'master'
Nouveau site du COF

See merge request klub-dev-ens/gestioCOF!247
2019-01-14 21:23:10 +01:00
Ludovic Stephan
bb23c45fad Remove Django-debug-toolbar in admin interface
La présence de DJDT sur l'interface admin multiplie par 100 environ
(sans exagération) les temps de chargement des pages, cause des 503, et
a une utilité au plus limitée. Cette MR vire donc l'addon de l'interface
admin.
2019-01-07 17:38:55 +01:00
Aurélien Delobelle
84c88dfd5e Merge branch 'master' into aureplop/site-cof 2019-01-06 00:56:21 +01:00
Aurélien Delobelle
39eaf4b109 style -- black + isort 2019-01-06 00:37:08 +01:00
Basile Clement
c960d97b67 Extrait les petits cours dans une application séparée
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
2018-11-25 13:25:16 +01:00
Martin Pépin
712588af7d Merge branch 'master' into evarin/site-cof 2018-11-19 23:30:33 +01:00
Basile Clement
00a1e79af6 Fix CAS support in python-cas 1.3+
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
2018-11-12 00:54:44 +01:00
Aurélien Delobelle
fdd2b35289 core -- Apply black + isort to all files 2018-10-06 13:15:33 +02:00
Aurélien Delobelle
ece9a54df3 Upgrade to reCAPTCHA v2
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.
2018-05-14 13:22:59 +02:00
Evarin
6d72644ee3 Clean code up 2018-04-28 15:59:49 +02:00
Martin Pépin
a73736bf41 Merge branch 'master' into Kerl/drop_py2_compat 2018-04-16 14:12:36 +02:00
Martin Pépin
a7cd1e04cd prefer CORS_ORIGIN_WHITELIST to CORS_ORIGIN_REGEX_WHITELIST 2018-04-08 22:33:19 +02:00
Martin Pépin
556c354f8a Merge branch 'master' into Roussille/bda 2018-04-08 22:30:48 +02:00
Martin Pepin
d88ce44989 Merge branch 'aureplop/fix-autocomplete-js' into 'master'
Fix autocomplete in registration views.

See merge request cof-geek/gestioCOF!288
2018-02-05 22:49:18 +01:00
Evarin
59116f2d46 International wagtail urls 2018-02-03 22:34:37 +01:00
Evarin
8551ffcfd3 Merge branch 'master' into evarin/site-cof 2018-01-20 19:37:12 +01:00
Aurélien Delobelle
4084444dc3 Fix autocomplete in registration views.
django-autocomplete-light v3.x doesn't include anymore the
$('').yourlabsAutocomplete() function, leading to issues in cof
registration and kfet account creation views.

Adding jquery-autocomplete-light fixes these issues.

See:
- (dal) https://github.com/yourlabs/django-autocomplete-light
- (jal) https://github.com/yourlabs/jquery-autocomplete-light
2018-01-20 17:29:15 +01:00
Aurélien Delobelle
6059ca067b Speed up tests
~20% less using MD5 and force_login in kfet testcase.
~77% less by disabling the debug tollbar.
2018-01-15 05:41:51 +01:00
Martin Pépin
5a5b60ec4d Merge branch 'master' into Kerl/drop_py2_compat 2018-01-10 20:12:59 +01:00
Martin Pépin
475f1adec5 Remove "coding: utf8" line 2018-01-06 16:10:13 +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
1c90d067fa Make cof.settings a module 2017-10-26 18:13:09 +02:00
Martin Pépin
40abe27e81 EMAIL_HOST needs to be set but as a secret 2017-10-25 22:05:14 +02:00
Martin Pépin
b9aaea0f99 Merge branch 'master' into Production 2017-10-16 14:26:05 +02:00
Martin Pépin
b73faa3b84 Merge branch 'master' into Production 2017-09-25 18:40:00 +02:00
Aurélien Delobelle
b42452080f Mass cleaning of kfet' authentication machinery
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!
2017-09-25 17:57:47 +02:00
Martin Pépin
4091185a68 import LDAP_SERVER_URL in settings 2017-09-20 18:19:15 +02:00
Aurélien Delobelle
bf61e41b50 Move auth-related from 'kfet' app to 'kfet.auth'. 2017-09-19 17:05:51 +02:00
Hugo Roussille
a4eedbc1a6 Whitelist bda and cof apps for cross-domain 2017-09-13 18:21:34 +02:00
Hugo Roussille
4bd2562edf django-cors-headers for cross-domain AJAX 2017-09-13 15:57:57 +02:00
Martin Pépin
1921f05eba Move STATIC_ROOT in production 2017-09-12 09:22:54 +02:00
Martin Pépin
2a519bfedf Add SCRIPT_NAME to the production-like server 2017-08-13 14:36:45 +01:00
Martin Pépin
4c08962e09 Hide more stuff in secret.py 2017-08-13 13:39:13 +01:00
Martin Pépin
5923166196 Specify the full path of the sqlite database 2017-08-11 17:24:09 +01:00
Martin Pépin
ad15c45237 Switch to nginx + postgres in vagrant 2017-08-09 22:18:26 +01:00