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

12700 dummy fields #12872

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

JezFirth
Copy link
Contributor

Proposed changes

Modified __setattr__ in weblate.auth.models.py to take the first name and last name attributes and pass them as full_name in extra data.

Checklist

  • Lint and unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added documentation to describe my feature.
  • I have squashed my commits into logic units.
  • I have described the changes in the commit messages.

Other information

I struggled to replicate this issue through weblate. It seems that for User.objects.get_or_create with the dummy fields in the defaults parameter via the django shell, it would require first_name and last_name to be properties in the User class as it seems this function bypasses the weblate framework. This seems redundant however as their already exists a 'full_name` property.

Copy link

codecov bot commented Oct 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 91.12%. Comparing base (528df8f) to head (eb7be0a).
Report is 1962 commits behind head on main.

Files with missing lines Patch % Lines
weblate/auth/models.py 0.00% 3 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12872      +/-   ##
==========================================
- Coverage   91.13%   91.12%   -0.01%     
==========================================
  Files         597      597              
  Lines       61229    61233       +4     
  Branches     6350     6352       +2     
==========================================
  Hits        55798    55798              
- Misses       3776     3778       +2     
- Partials     1655     1657       +2     
Files with missing lines Coverage Δ
weblate/auth/models.py 91.68% <0.00%> (-0.67%) ⬇️

Copy link
Member

@nijel nijel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still doesn't handle the create() code path. Also when doing functional changes, please cover that with a test case.

@nijel nijel marked this pull request as draft November 6, 2024 14:32
Copy link

@BesBettison BesBettison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weblate

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.

3 participants