Gérer la fin de scolarité #9

Merged
champeno merged 23 commits from Evarin/archicubes into master 2018-09-30 00:03:27 +02:00
Showing only changes of commit b6f5acaa46 - Show all commits

View file

@ -158,13 +158,36 @@ Configuration
}, },
} }
Auto-signup Auto-signup
Poulated data Populated data
- username: ``<clipper>`` - username: ``<clipper>``
- email (primary and verified): ``<clipper>@clipper.ens.fr`` - email (primary and verified): ``<clipper>@clipper.ens.fr``
Long Term Clipper Adapter
=========================
We provide an easy-to-use SocialAccountAdapter to handle the fact that Clipper Accounts are not eternal, and that there is no guarantee that the clipper usernames won't be reused later.
This adapter also handles getting basic information about the user from SPI's LDAP.
Configuration
Set ``SOCIALACCOUNT_ADAPTER='allauth_ens.adapter.LongTermClipperAccountAdapter'`` in `settings.py`
Auto-signup
Populated data
- username: ``<clipper>@<entrance year>``
- email: from LDAP's `mailRoutingAddress` field, or ``<clipper>@clipper.ens.fr``
- first_name, last_name from LDAP's `cn` field
- extra_data in SociallAccount instance, containing these field, plus `anne` and `promotion` from LDAP's `homeDirectory` field (available only on first connection)
Account deprecation
At the beginning of each year (i.e. early November), to prevent clipper username conflicts, you should run ``$ python manage.py deprecate_clippers``. Every association clipper username <-> user will then be set on hold, and at the first subsequent connection, a verification of the account will be made (using LDAP), so that a known user keeps his account, but a newcomer won't inherit an archicube's.
Customize
You can customize the SocialAccountAdapter by inheriting ``allauth_ens.adapter.LongTermClipperAccountAdapter``. You might want to modify ``get_username(clipper, data)`` to change the default username format. This function is used to disambiguate in the account deprecation process.
********* *********
Demo Site Demo Site
********* *********
@ -201,7 +224,11 @@ Tests
Local environment Local environment
----------------- -----------------
``$ ./runtests.py`` Requirements
* fakeldap and mock, install with ``$ pip install mock fakeldap``
Run
* ``$ ./runtests.py``
All All
--- ---