-
Notifications
You must be signed in to change notification settings - Fork 205
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 job group update issue #1533
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1533 +/- ##
==========================================
+ Coverage 87.87% 87.95% +0.07%
==========================================
Files 106 106
Lines 8223 8225 +2
==========================================
+ Hits 7226 7234 +8
+ Misses 997 991 -6
Continue to review full report at Codecov.
|
|
||
return 0 if $self->is_parent; | ||
my $properties = $self->load_properties; | ||
return $self->resultset->search({name => $properties->{name}, parent_id => undef}); | ||
unless ($group_id) { | ||
return $self->resultset->search({name => $properties->{name}, parent_id => undef}); |
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.
please don't duplicate so much code. the argument to search is a hash and it's only different in one key.
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.
fixed
return $self->resultset->search({name => $properties->{name}, parent_id => undef}); | ||
my $conditions = {name => $properties->{name}, parent_id => undef}; | ||
unless ($group_id) { | ||
return $self->resultset->search($conditions); |
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.
now this line is the same as 3 lines later. So please just move the $conditions->{id} = into an if - and return the search uncondiotionally
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.
yes, got it...
commit 63e3526 Author: Wei Jiang <mitiao@gmail.com> AuthorDate: Mon Dec 11 16:44:30 2017 +0800 Commit: Stephan Kulow <stephan@kulow.org> CommitDate: Mon Dec 11 09:44:30 2017 +0100 Fix job group update issue (#1533) See: https://progress.opensuse.org/issues/29110
See: https://progress.opensuse.org/issues/29110