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
6cd174cd
Commit
6cd174cd
authored
Aug 21, 2015
by
Enrico Zini
Browse files
Deal with missing stats
parent
4210c247
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/templates/public/process.html
View file @
6cd174cd
...
...
@@ -154,6 +154,7 @@ See: <a href="http://lists.debian.org/debian-project/2010/09/msg00026.html">hand
{% endif %}
</td>
</tr>
{% if mbox_stats %}
<tr><th>
Mailbox stats
</th>
<td>
{{mbox_stats.date_first_py|date:"Y-m-d"}} to {{mbox_stats.date_last_py|date:"Y-m-d"}},
{{mbox_stats.num_mails}} mails,
...
...
@@ -165,6 +166,7 @@ See: <a href="http://lists.debian.org/debian-project/2010/09/msg00026.html">hand
</td>
</tr>
{% endif %}
{% endif %}
</table>
{% if "edit_bio" in vperms.perms or "edit_ldap" in vperms.perms %}
<a
href=
"{% url 'restricted_person' key=person.lookup_key %}"
>
Edit personal information
</a>
...
...
public/views.py
View file @
6cd174cd
...
...
@@ -227,13 +227,14 @@ class Process(VisitorTemplateView):
stats
=
stats
.
get
(
"process"
,
{})
stats
=
stats
.
get
(
process
.
lookup_key
,
{})
stats
[
"date_first_py"
]
=
datetime
.
datetime
.
fromtimestamp
(
stats
[
"date_first"
])
stats
[
"date_last_py"
]
=
datetime
.
datetime
.
fromtimestamp
(
stats
[
"date_last"
])
if
"median"
not
in
stats
or
stats
[
"median"
]
is
None
:
stats
[
"median_py"
]
=
None
else
:
stats
[
"median_py"
]
=
datetime
.
timedelta
(
seconds
=
stats
[
"median"
])
stats
[
"median_hours"
]
=
stats
[
"median_py"
].
seconds
//
3600
if
stats
:
stats
[
"date_first_py"
]
=
datetime
.
datetime
.
fromtimestamp
(
stats
[
"date_first"
])
stats
[
"date_last_py"
]
=
datetime
.
datetime
.
fromtimestamp
(
stats
[
"date_last"
])
if
"median"
not
in
stats
or
stats
[
"median"
]
is
None
:
stats
[
"median_py"
]
=
None
else
:
stats
[
"median_py"
]
=
datetime
.
timedelta
(
seconds
=
stats
[
"median"
])
stats
[
"median_hours"
]
=
stats
[
"median_py"
].
seconds
//
3600
ctx
[
"mbox_stats"
]
=
stats
return
ctx
...
...
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