By default, set the fullname from first+last and vice-versa
Fixes #678.
Proposed changes
As described in #678 , when the SAML backend supplies a fullname, it's desirable for my Django user to have first_name and last_name set. This changes PSA so if fullname is set (in, eg, a SAML response) but not first_name/last_name, by default it generates a first_name and last_name automatically. Similarly, it does the reverse transformation when fullname is missing. IMO this is a net improvement, but obviously there's questions like "should this be enabled by default", "should it be in the default pipeline", etc. -- I'm happy to tweak this to make it fit the team's design goals better. Assuming the concept makes sense, I can write docs.
Types of changes
Please check the type of change your PR introduces:
- [ ] 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
Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.
- [X?] Lint and unit tests pass locally with my changes -- running tox reports an error in test_dummy both before and after my change
- [ ] I have added tests that prove my fix is effective or that my feature works
Other information
Any other information that is important to this PR such as screenshots of how the component looks before and after the change.
Codecov Report
Merging #683 (3cfc739) into master (f27461d) will decrease coverage by
0.06%. The diff coverage is10.00%.
@@ Coverage Diff @@
## master #683 +/- ##
==========================================
- Coverage 77.01% 76.94% -0.07%
==========================================
Files 319 319
Lines 9677 9687 +10
Branches 1036 1040 +4
==========================================
+ Hits 7453 7454 +1
- Misses 2072 2081 +9
Partials 152 152
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 76.94% <10.00%> (-0.07%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| social_core/pipeline/__init__.py | 100.00% <ø> (ø) |
|
| social_core/pipeline/social_auth.py | 78.18% <10.00%> (-15.16%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update f27461d...3cfc739. Read the comment docs.
Any thoughts on this general feature?