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 Repo form in django admin #772

Merged
merged 1 commit into from
Aug 27, 2024
Merged

fix Repo form in django admin #772

merged 1 commit into from
Aug 27, 2024

Conversation

nora-codecov
Copy link
Contributor

Purpose/Motivation

It's a common issue to have null=True or a default_value without blank=True on a field in a django model. This causes a conflict in forms, which interprets the field as required even though you intend for the value to be null or the default_value set on the field. In my case, I was trying to clear out the webhook_secret field, but my changes were blocked because the webhook_secret cannot be blank, therefore there was no way to get it back to the null value I wanted, which is allowed in the database.

Links to relevant tickets

part of https://github.com/codecov/internal-issues/issues/366

What does this PR do?

I need to be able to delete the webhook_secret, this was not allowed by the form. These changes allow me to clear out that field, fixed it on a few other fields on the model as well so that it behaves closer to how we intended.

@nora-codecov nora-codecov requested a review from a team August 26, 2024 22:30
@codecov-notifications
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.14%. Comparing base (80d64ad) to head (3ce07ae).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@               Coverage Diff                @@
##               main       #772        +/-   ##
================================================
+ Coverage   96.13000   96.14000   +0.01000     
================================================
  Files           812        812                
  Lines         18385      18395        +10     
================================================
+ Hits          17675      17685        +10     
  Misses          710        710                
Flag Coverage Δ
unit 91.94% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.94% <100.00%> (+<0.01%) ⬆️

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

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

@nora-codecov nora-codecov added this pull request to the merge queue Aug 27, 2024
Merged via the queue into main with commit 2d0f159 Aug 27, 2024
17 of 18 checks passed
@nora-codecov nora-codecov deleted the nora/366 branch August 27, 2024 17:31
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.

2 participants