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

Add management command to set site_address_is_company_address for existing projects #5943

Conversation

oliverjwroberts
Copy link
Contributor

Description of change

This PR adds a management command to set site_address_is_company_address to a sensible default for existing projects. This will avoid the majority of users having to re-visit the question in the frontend if they've previously answered the site_decided question.

Business rules are as follows for projects that have:

  • site_address_is_company_address == None and site_decided == True: set site_address_is_company_address to False.
  • site_address_is_company_address == None and site_decided == False/None: leave site_address_is_company_address as None.

Once this management command has been run once in production, it shall be removed.

Checklist

  • Has this branch been rebased on top of the current main branch?

    Explanation

    The branch should not be stale or have conflicts at the time reviews are requested.

  • Is the CircleCI build passing?

General points

Other things to check

  • Make sure fixtures/test_data.yaml is maintained when updating models
  • Consider the admin site when making changes to models
  • Use select-/prefetch-related field lists in views and search apps, and update them when fields are added
  • Make sure the README is updated e.g. when adding new environment variables

See docs/CONTRIBUTING.md for more guidelines.

@oliverjwroberts oliverjwroberts self-assigned this Feb 5, 2025
@oliverjwroberts oliverjwroberts requested a review from a team as a code owner February 5, 2025 10:23
@oliverjwroberts oliverjwroberts force-pushed the feature/CLS2-1237-set-site-address-for-existing-projects branch from c0955e2 to f822b4f Compare February 5, 2025 10:56
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.64%. Comparing base (ce7c202) to head (f822b4f).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5943      +/-   ##
==========================================
- Coverage   96.65%   96.64%   -0.01%     
==========================================
  Files        1070     1071       +1     
  Lines       25262    25278      +16     
  Branches     1664     1665       +1     
==========================================
+ Hits        24416    24431      +15     
- Misses        690      691       +1     
  Partials      156      156              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oliverjwroberts oliverjwroberts merged commit 3cae9ac into main Feb 5, 2025
7 checks passed
@oliverjwroberts oliverjwroberts deleted the feature/CLS2-1237-set-site-address-for-existing-projects branch February 5, 2025 17:26
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