django-allauth icon indicating copy to clipboard operation
django-allauth copied to clipboard

[WIP]save only updated fields

Open Akay7 opened this issue 2 years ago • 1 comments

Submitting Pull Requests

General

  • [ ] Make sure you use semantic commit messages. Examples: "fix(google): Fixed foobar bug", "feat(accounts): Added foobar feature".
  • [ ] All Python code must formatted using Black, and clean from pep8 and isort issues.
  • [ ] JavaScript code should adhere to StandardJS.
  • [ ] If your changes are significant, please update ChangeLog.rst.
  • [ ] If your change is substantial, feel free to add yourself to AUTHORS.

Provider Specifics

There is possible to get raise conditions. I.e.

  1. allauth update email field of the user in the memory
  2. another process update some other user fields
  3. allauth save user into DB and this will override all changes on step 2

My point that is better to specify fields to update, in order to keep changes(https://docs.djangoproject.com/en/4.0/ref/models/instances/#specifying-which-fields-to-save). But cons of that solution that could be some fields that should be updated on the user save, ie updated_at and because it's not specified they wont updated during save.

@pennersr please let me know if those changes could be useful for the project. I'm also not sure that is raise condition test could be implemented in the unittest. Maybe you have any suggestions about that.

In case you add a new provider:

  • [ ] Make sure unit tests are available.
  • [ ] Add an entry of your provider in test_settings.py::INSTALLED_APPS and docs/installation.rst::INSTALLED_APPS.
  • [ ] Add documentation to docs/providers.rst.
  • [ ] Add an entry to the list of supported providers over at docs/overview.rst.

Akay7 avatar Jul 27 '22 06:07 Akay7

Coverage Status

Coverage: 91.765% (-0.5%) from 92.22% when pulling 6998b086bf7a3f803e484766d0d434731969bcc3 on Akay7:fixRaiseConditionOnSaveUser into 18d941345bc669eb30c9d84d3ed726d7d536900b on pennersr:master.

coveralls avatar Jul 27 '22 06:07 coveralls