Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the User database model by dropping unused columns #2944

Merged
merged 2 commits into from
May 29, 2019

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented May 28, 2019

Fixes #2928

The following columns are dropped:

  • password
  • date_joined
  • groups
  • is_active
  • is_staff
  • is_superuser
  • last_login
  • user_permissions

These columns were originally added because the base user class of the
Django framework was used, which provided the ORM layer. However, these
attributes are not used at all and Django does not require them in order
to work properly. Therefore, we remove them from the models for both
backends.

Note that in principle, the contrib and auth applications currently
installed for Django, could also be removed without affecting the
functionality of aiida-core since it no longer requires the built in
authentication application of Django. However, since the initial
migration schema still references it, we cannot yet remove it fully.
If we were to reset the database migration schema, we could get rid of
these unnecessary dependencies.

This way we can make use of the reusable components of the `verdi`
command line module.
@coveralls
Copy link

coveralls commented May 28, 2019

Coverage Status

Coverage decreased (-0.08%) to 72.602% when pulling c0caf74 on sphuber:fix_2928_simplify_user_schema into b8eaffc on aiidateam:develop.

The following columns are dropped:

 * `password`
 * `date_joined`
 * `groups`
 * `is_active`
 * `is_staff`
 * `is_superuser`
 * `last_login`
 * `user_permissions`

These columns were originally added because the base user class of the
Django framework was used, which provided the ORM layer. However, these
attributes are not used at all and Django does not require them in order
to work properly. Therefore, we remove them from the models for both
backends.

Note that in principle, the `contrib` and `auth` applications currently
installed for Django, could also be removed without affecting the
functionality of `aiida-core` since it no longer requires the built in
authentication application of Django. However, since the initial
migration schema still references it, we cannot yet remove it fully.
If we were to reset the database migration schema, we could get rid of
these unnecessary dependencies.
@sphuber sphuber merged commit 6588683 into aiidateam:develop May 29, 2019
@sphuber sphuber deleted the fix_2928_simplify_user_schema branch May 29, 2019 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify the User database model
3 participants