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
Centralise update creation to include fields. #3111
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3111 +/- ##
==========================================
+ Coverage 83.39% 83.42% +0.02%
==========================================
Files 248 248
Lines 15571 15574 +3
Branches 2907 2906 -1
==========================================
+ Hits 12986 12992 +6
Misses 1660 1660
+ Partials 925 922 -3
Continue to review full report at Codecov.
|
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.
Teeny comment that I think is not important, otherwise, yay for less repetition.
@@ -206,16 +206,12 @@ sub submit_standard : Private { | |||
$update = $c->model('DB::Comment')->new( | |||
{ | |||
problem => $problem, | |||
name => $problem->name, |
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.
On the off chance they've used a different name subsequent to making the report removing this will change the behaviour. I'm not sure it's worth being concerned about though.
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.
Yeah, I spotted that, then I thought might be better anyway to use the name currently associated with the account filling it in at the time it's filled in 👍
Given the user, we can infer the name if not provided, and the extra data if a staff user. We can also provide defaults for various other fields. Always have superuser take precedence over from_body.
82436e3
to
67823bc
Compare
Given the user, we can infer the name if not provided, and the extra
data if a staff user. We can also provide defaults for various other
fields. Always have superuser take precedence over from_body.