Commit Graph

11 Commits

Author SHA1 Message Date
Valentin Deniaud b6b6652156 custom_user: exclude deleted users from duplicates (#47353) 2020-10-05 16:54:19 +02:00
Valentin Deniaud e6b2e5dbf4 api: add find duplicate users endpoint (#46424) 2020-10-01 13:29:24 +02:00
Benjamin Dauvergne e090ad25a7 misc: implement customized date search for birthdate attribute (#44656) 2020-07-06 14:43:53 +02:00
Benjamin Dauvergne bda672d59e misc: add a DeletedUser model to keep metadata about deleted users (#41933) 2020-05-18 16:21:59 +02:00
Benjamin Dauvergne 9f0aa6ad3c misc: replace DeletedUser model by attribute deleted on User (#41930) 2020-05-15 10:49:47 +02:00
Paul Marillonnet f63bd36159 python3: reduce needs proper six import (#32449) 2020-02-06 10:24:28 +01:00
Benjamin Dauvergne dd72a96030 custom_user: return early on empty search terms (#33586) 2019-05-31 12:22:02 +02:00
Benjamin Dauvergne 9fbbf0519a spring cleaning (#32934)
* reorganize views and forms
* add copyright headers to all .py files
* fix all style errors reported by flake8
2019-05-14 16:19:25 +02:00
Emmanuel Cazenave 0876d25dbd api: free text search on users (#15736) 2018-11-27 10:56:05 +01:00
Benjamin Dauvergne e28b4b52cf custom_user: restore username as the USERNAME_FIELD (fixes #17593)
System check auth.W004 must be disabled as username is not unique.
2017-07-13 09:53:32 +02:00
Benjamin Dauvergne 96500dd0ac Create a custom user model (fixes #6919)
- Add new model User through a custom user application, Django needs
  custom user models to be introduced in the first migration of an
  application, it features:
  - username length is 256 chars
  - username is nullable and optional
  - email is 254 chars
  - email default validator is our own
  - User has an automatic uuid field using uuid.uuid4
  - Module fix_user_model.py can be removed
  - Old user models are automatically converted to new custom user model
  - Registration form does not have to generate an uuid username anymore
- Add migrations to fix foreign key in our own applications and in third
  party applications out of our control like django-admin-tools and
  django-admin (the AlterField migration operation was overrided for
  theses cases)
  django.contrib.auth.models.User to authentic2.models.User
- Set AUTH_USER_MODEL to authentic2.User
- Register custome_user.User in admin site
- Remove all monkey patching to Django default user model
- username field is now forced in the model backend, as the
  USERNAME_FIELD attribute is now `uuid`.
- Create a local modelform_factory implementation, it specializes User
  model by always using authentic2.forms.BaseUserForm as a base class and
  add a new parameter `required` which allow to set the required flag on
  fields without setting it on the model.
- Add a BaseUserForm base model-form class supporting custom fields
  created using the Attribute model.
- Refactor profile editing form, user admin form, manage user edit form
  and registrationform using using the new modelform_factory based on the
  BaseUserForm class.
- Added new settings:
  - A2_USERNAME_IS_UNIQUE: it adds checking that the username attribute
    is unique before saving a user object
  - A2_REGISTRATION_USERNAME_IS_UNIQUE: it adds checking that the
    username attribute is unique before saving a user object; same as
    above but only for self-registered users.
  - A2_EMAIL_IS_UNIQUE: same as above but for email
- Remove all unused symbols in authentic2.compat: use_attribute_aggregator, get_required_fields and get_registration_fields
-
2015-04-15 11:30:38 +02:00