-
Notifications
You must be signed in to change notification settings - Fork 37
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
Allow users to swap project IDs across timecard entries #886
Conversation
Deferring constraints when saving TimeCardObject formsets thereby allowing users to swap project IDs between existing entries on a timecard.
""" | ||
Save with deferred constraints | ||
Allowing users to swap project IDs between TimeCardObjects | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this gets a bit down into the gears of things, can we either write up more on what we're doing or is there a link we can offer that gets into the details?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrote this up more comprehensively in #887
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats great, but I'm thinking of future person reading forms.py who's confused by what this is and why we did it. I want to leave them a bit more context here (or link to more context). I'd be totally OK just linking back to #887 for future person, though. That's a pretty in-depth explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha! Added details clarifying the custom save behavior here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thank you!
This resolves #881 right? |
Thanks @tbaxter-18f, We'll address #881 separately, this PR doesn't include any modification/assessment of |
Codecov Report
@@ Coverage Diff @@
## master #886 +/- ##
==========================================
+ Coverage 91.6% 91.64% +0.03%
==========================================
Files 39 39
Lines 1680 1687 +7
==========================================
+ Hits 1539 1546 +7
Misses 141 141
Continue to review full report at Codecov.
|
Working towards a resolution of #887 with this PR. |
Recreating the
TimeCardObject
unique constraint as deferrable and deferring when saving TimeCardObject formsets thereby allowing users to swap project IDs betweenexisting entries on a timecard.
Description
Prior to this PR, attempts to swap project IDs between existing entries, either intentional or inadvertent, prevented users from submitting their timecard without providing any useful error message or pathway to resolve.