Identify Qiita users by permanent_id
Proposed changes
- Generate UserSocialAuth with
permanent_idin Qiita backend.- Currently Qiita backend identifies UserSocialAuth by
id, but this value can be changed by renaming the account name. - According to the official documentation,
permanent_idis available as a generated ID for each user.
- Currently Qiita backend identifies UserSocialAuth by
- To maintain compatibility, the behavior is modified by the settings variable
SOCIAL_AUTH_QIITA_IDENTIFIED_BY_PERMANENT_ID.- If unspecified, identified by
id.
- If unspecified, identified by
- More user information can be referenced in
extra_data. - Add tests for new behaviors.
Types of changes
- [ ] Release (new release request)
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Code style update (PEP8, lint, formatting, renaming, etc)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Build related changes (build process, tests runner, etc)
- [ ] Other (please describe):
Checklist
- [x] Lint and unit tests pass locally with my changes
- [x] I have added tests that prove my fix is effective or that my feature works
Other information
I use this library in my business and always appreciate it! I am not an English speaker, so I would be happy to point out any discrepancies in naming variables, etc.
I verified that the test passed with the make tests command in my local, but it did not run for Python 3.10.

Can you please update the documentation at https://github.com/python-social-auth/social-docs as well?
Codecov Report
Merging #698 (b5b6395) into master (031e2c7) will increase coverage by
0.09%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #698 +/- ##
==========================================
+ Coverage 77.20% 77.30% +0.09%
==========================================
Files 323 323
Lines 9766 9809 +43
Branches 1045 1051 +6
==========================================
+ Hits 7540 7583 +43
Misses 2072 2072
Partials 154 154
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 77.30% <100.00%> (+0.09%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| social_core/backends/qiita.py | 94.44% <100.00%> (+1.85%) |
:arrow_up: |
| social_core/tests/backends/test_qiita.py | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Thank you for your review. I have created the following PR. https://github.com/python-social-auth/social-docs/pull/116
@nijel I was going to create another branch to handle this, but I messed up using the forked repository and added the commit to this branch. I am sorry but please point out any problems.
In my local:
$ flake8 social_core/
$ echo $?
0
Can you please separate the flake8 changes from the Qiita ones? Keeping it one topic in PR is preferred...
My apologies. I have created a flake8 PR based on the current master branch. https://github.com/python-social-auth/social-core/pull/707
Also, the flake8 error related to qiita has been fixed in this PR. https://github.com/python-social-auth/social-core/pull/698/commits/b5b63958053bf7e6f6b1f6952c07308dc291bd16
Merged, thanks for your contribution!