Skip to content

Conversation

Hell1213
Copy link

Description

This PR improves the pylint score for the web.models module as part of issue #4557.

=> Changes Made

  • Fix __str__ method in Team model to return str(self.name) instead of self.name
  • Replace old-style string formatting with f-strings in Contact and Subscribers models
  • Update Contact model __str__ method to use f-string formatting
  • Update Subscribers model __str__ method to use f-string formatting

=> Pylint Score Improvements

  • Web.models module: Improved from ~9.55 to 10.00/10
  • Error-level issues: All fixed

=> Testing

  • All models import successfully
  • No error-level pylint issues remaining
  • Local testing passed

Continues work on issue #4557

- Fix __str__ method in UserStatus modell to return str(self.name) instead of self.name
- Rename conflicting admin classes to avoid redefinition errors:
  - UserAdmin -> CustomUserAdmin
  - TokenAdmin -> CustomTokenAdmin
  - EmailAddressAdmin -> CustomEmailAddressAdmin
- Replace old-style string formatting with f-strings in views.py
- Fix typo: recieve_newsletter -> receive_newsletter
- Improve search fields in ProfileAdmin

Pylint score improved from ~8.17 to 9.58/10 for accounts module.
Overall pylint score improved to 8.20/10 (above target of 7.5).

Fixes Cloud-CV#4557
- Revert admin field name from 'receive_newsletter' to 'recieve_newsletter'
- This matches the actual field name in the Profile model
- Fixes Django system check errors that were causing CI to fail

The field name in the model still has the typo, but changing it would require
a database migration. For now, keeping the admin consistent with the model.
- Fix __str__ method in Team model to return str(self.name) instead of self.name
- Replace old-style string formatting with f-strings in Contact and Subscribers models
- Pylint score improved from ~9.55 to 10.00/10 for web.models module

Continues work on issue Cloud-CV#4557
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.86%. Comparing base (e9e38e9) to head (615fcfb).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4793      +/-   ##
==========================================
- Coverage   91.87%   91.86%   -0.02%     
==========================================
  Files          85       85              
  Lines        7105     7105              
==========================================
- Hits         6528     6527       -1     
- Misses        577      578       +1     
Flag Coverage Δ
backend 96.66% <100.00%> (ø)
frontend 87.11% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Accounts & Authentication 100.00% <100.00%> (ø)
Challenges Management 95.34% <ø> (ø)
Job Processing 98.19% <ø> (ø)
Participants & Teams 100.00% <ø> (ø)
Challenge Hosts 100.00% <ø> (ø)
Analytics 100.00% <ø> (ø)
Web Interface 100.00% <100.00%> (ø)
Frontend (Gulp) 87.11% <ø> (-0.03%) ⬇️
All Models 97.58% <100.00%> (ø)
All Views 100.00% <ø> (ø)
All Serializers 98.82% <ø> (ø)
Utility Functions 96.79% <ø> (ø)
Core Configuration 82.35% <ø> (ø)
Files with missing lines Coverage Δ
apps/accounts/admin.py 100.00% <100.00%> (ø)
apps/accounts/models.py 100.00% <100.00%> (ø)
apps/web/models.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Files with missing lines Coverage Δ
apps/accounts/admin.py 100.00% <100.00%> (ø)
apps/accounts/models.py 100.00% <100.00%> (ø)
apps/web/models.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9e38e9...615fcfb. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant