Skip to content

Commit 3ec381d

Browse files
committed
wip
1 parent 2a03685 commit 3ec381d

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

patchwork/templates/patchwork/submission.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{% load humanize %}
44
{% load syntax %}
55
{% load person %}
6+
{% load user %}
67
{% load patch %}
78
{% load static %}
89
{% load utils %}
@@ -194,9 +195,9 @@ <h2>Notes</h2>
194195
<a name="{{ item.id }}"></a>
195196
<div class="submission-message">
196197
<div class="meta">
197-
{{ note.patch.submitter|personify:project }}
198+
User: {{ note.submitter|userfy }},
198199
<span class="message-date">
199-
Last modified: {{ note.last_modified }} UTC
200+
Last modified: {{ note.updated_at }} UTC
200201
</span>
201202
</div>
202203
<pre class="content">

patchwork/templatetags/user.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patchwork - automated patch tracking system
2+
# Copyright (C) 2024 Meta Platforms, Inc. and affiliates.
3+
#
4+
# SPDX-License-Identifier: GPL-2.0-or-later
5+
6+
from django import template
7+
from django.utils.html import escape
8+
from django.utils.safestring import mark_safe
9+
10+
11+
register = template.Library()
12+
13+
14+
@register.filter
15+
def userfy(user):
16+
if user.first_name and user.last_name:
17+
linktext = escape(f'{user.first_name} {user.last_name}')
18+
elif user.email:
19+
linktext = escape(user.email)
20+
else:
21+
linktext = escape(user.username)
22+
23+
return mark_safe(linktext)

0 commit comments

Comments
 (0)