Merge lp:~cjohnston/qa-dashboard/sru-attention into lp:qa-dashboard
Proposed by
Chris Johnston
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Joe Talbott | ||||
Approved revision: | 285 | ||||
Merged at revision: | 295 | ||||
Proposed branch: | lp:~cjohnston/qa-dashboard/sru-attention | ||||
Merge into: | lp:qa-dashboard | ||||
Diff against target: |
269 lines (+105/-81) 1 file modified
sru/management/commands/jenkins_pull_sru.py (+105/-81) |
||||
To merge this branch: | bzr merge lp:~cjohnston/qa-dashboard/sru-attention | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Joe Talbott | Approve | ||
Review via email: mp+153041@code.launchpad.net |
Commit message
Fixes the pulling bugs in SRU
To post a comment you must log in.
On 03/12/2013 08:40 PM, Chris Johnston wrote: get(bug_ no=bug_ no) create( bug_no= bug_no, status='unknown') bugs.all( )): bugs.add( bug)
> + bug = None
> + try:
> + bug = Bug.objects.
> + except Bug.DoesNotExist:
> + bug = Bug.objects.
> + if bug not in list(sruresult.
> + sruresult.
> + sruresult.save()
I noticed that pattern used a bit in this module. Is there a reason you
aren't using "get_or_create"[1]? I think that method is more fool-proof
and race-condition safe.
1: /docs.djangopro ject.com/ en/dev/ ref/models/ querysets/ #get-or- create>
<https:/