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

fix: DEV-3430: Adding CreateOnlyFieldsMixin and adding to BaseUserSerializer to make email only writeable on create #3027

Merged
merged 6 commits into from
Oct 4, 2022

Conversation

wesleylima
Copy link
Contributor

@wesleylima wesleylima commented Sep 28, 2022

The approach here was to create a mixin that allows developers to define create_only_fields in a Serializer's Meta class.
I believe this feature doesn't exist in the codebase yet and I think it's likely it will be reused.

The behavior when a "create_only" field is added on an update operation is that the requests completes successfully while ignoring any fields that were "create_only". This is analogous to how django-rest-api Serializer handles read_only fields.

…alizer to make email only writeable on create
@github-actions github-actions bot added the fix label Sep 28, 2022
@bmartel bmartel changed the title fix: Adding CreateOnlyFieldsMixin and adding to BaseUserSerializer to make email only writeable on create fix: DEV-3430: Adding CreateOnlyFieldsMixin and adding to BaseUserSerializer to make email only writeable on create Sep 28, 2022
@swarmia
Copy link

swarmia bot commented Sep 28, 2022

@codecov
Copy link

codecov bot commented Sep 30, 2022

Codecov Report

Base: 77.80% // Head: 77.51% // Decreases project coverage by -0.28% ⚠️

Coverage data is based on head (0ca0ae7) compared to base (17b40da).
Patch has no changes to coverable lines.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3027      +/-   ##
===========================================
- Coverage    77.80%   77.51%   -0.29%     
===========================================
  Files          137      146       +9     
  Lines         9951    10790     +839     
===========================================
+ Hits          7742     8364     +622     
- Misses        2209     2426     +217     
Impacted Files Coverage Δ
label_studio/label_studio/users/mixins.py 75.00% <0.00%> (-12.50%) ⬇️
...bel_studio/label_studio/organizations/functions.py 66.66% <0.00%> (-10.26%) ⬇️
label_studio/label_studio/ml/api.py 83.69% <0.00%> (-6.85%) ⬇️
...l_studio/label_studio/core/templatetags/filters.py 48.75% <0.00%> (-6.20%) ⬇️
..._studio/label_studio/core/settings/label_studio.py 94.28% <0.00%> (-5.72%) ⬇️
label_studio/label_studio/organizations/api.py 79.04% <0.00%> (-5.33%) ⬇️
.../label_studio/data_manager/actions/experimental.py 14.79% <0.00%> (-4.72%) ⬇️
label_studio/label_studio/tasks/api.py 88.26% <0.00%> (-4.43%) ⬇️
label_studio/label_studio/tasks/serializers.py 84.18% <0.00%> (-2.37%) ⬇️
label_studio/label_studio/data_manager/managers.py 79.49% <0.00%> (-2.22%) ⬇️
... and 76 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@vladimirheartex vladimirheartex marked this pull request as draft October 4, 2022 08:13
@wesleylima wesleylima marked this pull request as ready for review October 4, 2022 16:19
@wesleylima wesleylima merged commit 452eea7 into develop Oct 4, 2022
@github-actions github-actions bot deleted the fb-dev-3430 branch October 4, 2022 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants