Commit graph

199 commits

Author SHA1 Message Date
Martin Pépin
8895024a23 Fix COF membership unittest
We did not reload the right user from the database
2017-10-30 12:45:04 +01:00
Martin Pépin
5794f0945f rename userN -> cbds_userN in check_olddata 2017-10-30 11:26:05 +01:00
Aurélien Delobelle
09a88f768d Fix username conflicts with test suite and the…
…check_supportBDS_migrations script.
2017-10-28 18:08:40 +02:00
Aurélien Delobelle
09a96a0375 Fix postgres sequences
When manually assigning a value to AutoField, sequences must be updated
manually.

https://docs.djangoproject.com/en/1.11/ref/databases/#manually-specifying-values-of-auto-incrementing-primary-keys
2017-10-28 17:30:37 +02:00
Martin Pépin
d26da74520 Add missing module cof.signals 2017-10-26 14:50:47 +02:00
Martin Pépin
5ab090fa72 rm cofprofile.num, add PEI / GRATIS 2017-10-26 14:07:45 +02:00
Martin Pépin
0162f431d4 Some renamings gestioncof -> cof
The tests fail for an obscure reason:
django.db.utils.OperationalError: no such column: cof_cofprofile.num
2017-10-26 11:38:53 +02:00
Martin Pépin
9409b55df5 Merge migrations from master and supportBDS
- Add missing migrations
- Fix dependencies
- rename gestioncof -> cof
2017-10-26 11:06:17 +02:00
Martin Pépin
63963ce1f0 tmp 2017-10-26 09:34:56 +02:00
Martin Pépin
2aa2dafa13 Merge branch 'master' into supportBDS 2017-10-26 09:25:26 +02:00
Martin Pépin
9787770fc6 Merge branch 'supportBDS' into blah 2017-10-25 23:08:38 +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
Martin Pépin
1921f05eba Move STATIC_ROOT in production 2017-09-12 09:22:54 +02:00
Martin Pépin
52aadc636b Add custommail perms to staff groups 2017-09-09 15:55:22 +02:00
Aurélien Delobelle
29d288c567 Fix permissions setup of associations.
- Permissions of 'gestion' app are correctly added to the staff groups
of associations.
- Add tests to ensure staff groups of COF and BDS are correctly setup.
- Shortcut functions are added to retrieve COF and BDS association.
2017-09-05 15:02:33 +02:00
Aurélien Delobelle
5d572b3603 Clean supportBDS migrations.
- Fix some issues and improve efficiency of some RunPython code in
migrations.
- Merge some migrations.
- To simplify, any RunPython don't get a revert function.
2017-09-05 14:41:13 +02:00
Aurélien Delobelle
131c45e1c7 Add tests to check data migrations of supportBDS.
Run 'bash provisioning/check_migrations_supportBDS.sh' from the vagrant
VM.

This will do the following:
- delete the existing database 'cof_gestion', if applicable,
- apply migrations to render the database as pre-supportBDS,
- the last pre-supportBDS migration of 'cof' app creates some instances
using old database schema,
- supportBDS migrations are applied,
- finally, the 'check_olddata' command of 'cof' app ensures data has
been correctly migrated.

This commit should be reverted before reaching production stage.
2017-09-05 14:16:59 +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
Aurélien Delobelle
3842b5d160 Merge branch 'Kerl/supportBDS/events' into supportBDS
Move event-related models from 'cof' app to 'gestion' app.

Add 'Association' model to register name, related groups (buro,
members), etc.

Club is now associated with a single Association instance.

Migrations take care of these changes.
2017-08-11 19:59:24 +02: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
Martin Pépin
cb1d253517 Local development settings
- Add a new settings file for local development
- Update README.md according to the new setup
2017-08-09 22:17:27 +01:00
Aurélien Delobelle
fe840f2003 Add club view / update profile view
Profile view
- Let the user see his information.
- List the clubs whose he is a member.

Profile edition view
- Renamed from previous "profile" view
- User can now change "occupation" field.

Club detail view
- Informations about a club.
- Accessible by staff members and "respos" of the club.
- List members, with subscription fee (if applicable).

Club admin
- Change memberships of clubs added.
2017-08-09 12:53:44 +02:00
Martin Pépin
a6b0c51d39 Add SERVER_EMAIL to the secrets 2017-08-08 00:25:13 +01:00
Martin Pépin
81f3d6ab81 Move STATIC_ROOT in production 2017-08-08 00:24:00 +01:00
Martin Pépin
88597e62f1 More verbose secret error reporting 2017-08-08 00:06:03 +01:00
Martin Pépin
e578aef74d Fix circular deps in the migrations 2017-08-06 18:28:07 +01:00
Martin Pépin
b68590ffd7 Set the permissions for buro and members
BDS + COF

The permissions assignation is triggered by the `post_migrate` signal since the
permission table will only be populated after the migrations have been applied.
2017-06-24 23:45:04 +01:00
Aurélien Delobelle
455b730cc3 Merge branch 'master' into aureplop/kfet_cms 2017-06-23 02:53:05 +02:00
Aurélien Delobelle
19847ac9d8 add token check to raw_open edit view 2017-06-22 15:48:45 +02:00
Aurélien Delobelle
b8110c11a4 kfet.open
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.
2017-06-21 07:08:28 +02:00
Aurélien Delobelle
2381af92e3 Merge branch 'master' into aureplop/kfet_open 2017-06-21 05:47:53 +02:00
Martin Pepin
539c32dbbe Merge branch 'aureplop/fix_cache' into 'master'
Configure un système de cache

See merge request !221
2017-06-20 15:53:29 +02:00
Aurélien Delobelle
ec59bc2edc Merge branch 'master' into aureplop/kfet_open 2017-06-12 15:18:42 +02:00
Aurélien Delobelle
d004287957 Merge branch 'master' into aureplop/kfet_cms 2017-06-12 02:04:28 +02:00
Aurélien Delobelle
8c6d56b27c Add Wagtail CMS for kfet app.
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.
2017-05-30 20:44:30 +02:00
Martin Pépin
ea21b07657 Add an announcement banner 2017-05-25 23:58:59 +01:00
Martin Pepin
5d8427e601 Merge branch 'aureplop/fewer_requests' into 'master'
Moins de requêtes

See merge request !217
2017-05-12 21:13:35 +02:00
Aurélien Delobelle
e7266e7a9d use new settings for redis 2017-04-26 11:28:18 +02:00
Aurélien Delobelle
673dc0295d Merge branch 'master' into aureplop/fix_cache 2017-04-26 11:22:29 +02:00
Martin Pépin
dbff7740c8 Add REDIS_PORT to the settings and secrets 2017-04-25 20:23:21 +01:00
Martin Pépin
2aee43e01a Add more configuration options for redis
- `REDIS_HOST` can be specified in the secrets
- Two new secrets: `REDIS_PASSWD` and `REDIS_DB`
2017-04-24 22:17:41 +01:00
Aurélien Delobelle
2eee8f58aa Merge branch 'master' into aureplop/fewer_requests 2017-04-17 20:45:01 +02:00
Aurélien Delobelle
8622002e8d minor change 2017-04-17 20:40:54 +02:00
Aurélien Delobelle
dbf5844f6a Clean settings redis 2017-04-15 14:41:55 +02:00