Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Debian New Member Process
nm.debian.org
Commits
1895e230
Commit
1895e230
authored
Mar 13, 2012
by
Enrico Zini
Browse files
Check that last log progress matches process progress
parent
5b6ad991
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/models.py
View file @
1895e230
...
...
@@ -287,6 +287,13 @@ class Process(models.Model):
const
.
ALL_PROGRESS_DESCS
.
get
(
self
.
progress
,
self
.
progress
),
)
def
__repr__
(
self
):
return
"%s [%s %s->%s]"
%
(
self
.
lookup_key
,
self
.
person
.
lookup_key
,
self
.
person
.
status
,
self
.
applying_for
)
@
property
def
lookup_key
(
self
):
"""
...
...
maintenance/management/commands/maintenance.py
View file @
1895e230
...
...
@@ -118,6 +118,22 @@ class Checker(object):
log
.
warning
(
"%s has status %s but the last completed process was applying for %s"
,
p
.
uid
,
p
.
status
,
last_proc
.
applying_for
)
def
check_log_progress_match
(
self
,
**
kw
):
"""
Check that the last process with progress 'done' has the same
'applying_for' as the person status
"""
from
django.db.models
import
Max
for
p
in
bmodels
.
Process
.
objects
.
filter
(
is_active
=
True
):
try
:
last_log
=
p
.
log
.
order_by
(
"-logdate"
)[
0
]
except
IndexError
:
log
.
warning
(
"process %s has no log entries"
,
repr
(
p
))
continue
if
p
.
progress
!=
last_log
.
progress
:
log
.
warning
(
"process %s has progress %s but the last log entry has progress %s"
,
repr
(
p
),
p
.
progress
,
last_log
.
progress
)
def
check_enums
(
self
,
**
kw
):
"""
Consistency check of enum values
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment