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
c1e781c9
Unverified
Commit
c1e781c9
authored
Apr 21, 2022
by
Enrico Zini
Browse files
Date tweaks in certificates, and support great ancients
parent
b704c4b1
Pipeline
#370484
passed with stage
in 5 minutes and 38 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
person/templates/person/certificate.html
View file @
c1e781c9
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
{% load i18n %}
{% load i18n %}
{% load static %}
{% load static %}
{% load nm %}
{% load nm %}
{% load none_if_epoch %}
{% block head %}
{% block head %}
{{block.super}}
{{block.super}}
...
@@ -135,9 +136,13 @@ p {
...
@@ -135,9 +136,13 @@ p {
<div
id=
"cert-text"
class=
"textblock"
>
<div
id=
"cert-text"
class=
"textblock"
>
<p
id=
"cert-text-lead"
>
<p
id=
"cert-text-lead"
>
{% if person.status_changed|is_epoch %}
Since the very early years of Debian, is a
{% else %}
Has passed through the
<b>
New Maintainer Process
</b>
,
<br/>
Has passed through the
<b>
New Maintainer Process
</b>
,
<br/>
has been approved by
<b>
Debian Account Managers
</b>
,
<br/>
has been approved by
<b>
Debian Account Managers
</b>
,
<br/>
and therefore has become a
and therefore has become a
{% endif %}
</p>
</p>
<p
id=
"cert-status"
>
Debian Developer
</p>
<p
id=
"cert-status"
>
Debian Developer
</p>
...
@@ -151,7 +156,9 @@ p {
...
@@ -151,7 +156,9 @@ p {
<p>
Login: {{person.get_ldap_uid}}
</p>
<p>
Login: {{person.get_ldap_uid}}
</p>
<p>
Email address: {{person.get_ldap_uid}}@debian.org
</p>
<p>
Email address: {{person.get_ldap_uid}}@debian.org
</p>
<p>
PGP/GPG fingerprint: {{person.fpr|fingerprint}}
</p>
<p>
PGP/GPG fingerprint: {{person.fpr|fingerprint}}
</p>
<p>
Attainment date: {{person.status_changed}}
</p>
{% if not person.status_changed|is_epoch %}
<p>
Attainment date: {{person.status_changed|date:"Y-m-d"}}
</p>
{% endif %}
</div>
</div>
<div
id=
"cert-debian-url"
class=
"textblock"
>
<div
id=
"cert-debian-url"
class=
"textblock"
>
...
@@ -168,7 +175,7 @@ p {
...
@@ -168,7 +175,7 @@ p {
</div>
</div>
<div
id=
"cert-date"
class=
"textblock"
>
<div
id=
"cert-date"
class=
"textblock"
>
Date of Certificate issuance: {{
person.status_changed
}}
Date of Certificate issuance: {{
today
}}
</div>
</div>
{% endblock %}
{% endblock %}
person/views.py
View file @
c1e781c9
...
@@ -257,6 +257,7 @@ class Certificate(VisitPersonMixin, TemplateView):
...
@@ -257,6 +257,7 @@ class Certificate(VisitPersonMixin, TemplateView):
ctx
.
update
(
ctx
.
update
(
upload_rights
=
self
.
person
.
status
==
const
.
STATUS_DD_U
,
upload_rights
=
self
.
person
.
status
==
const
.
STATUS_DD_U
,
today
=
datetime
.
date
.
today
(),
)
)
return
ctx
return
ctx
public/templatetags/none_if_epoch.py
View file @
c1e781c9
...
@@ -4,6 +4,7 @@ import datetime
...
@@ -4,6 +4,7 @@ import datetime
register
=
template
.
Library
()
register
=
template
.
Library
()
@
register
.
filter
@
register
.
filter
def
none_if_epoch
(
value
):
def
none_if_epoch
(
value
):
epoch
=
datetime
.
datetime
(
1970
,
1
,
1
,
tzinfo
=
utc
)
epoch
=
datetime
.
datetime
(
1970
,
1
,
1
,
tzinfo
=
utc
)
...
@@ -11,3 +12,11 @@ def none_if_epoch(value):
...
@@ -11,3 +12,11 @@ def none_if_epoch(value):
return
None
return
None
else
:
else
:
return
value
return
value
@
register
.
filter
def
is_epoch
(
value
):
if
value
is
None
:
return
True
epoch
=
datetime
.
datetime
(
1970
,
1
,
1
,
tzinfo
=
utc
)
return
value
==
epoch
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