Skip to content

Commit

Permalink
feat(user): Show date of user creation (#10119)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik authored May 18, 2024
1 parent 3273c68 commit a8ef36e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dojo/api_v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ class Meta:


class UserSerializer(serializers.ModelSerializer):
date_joined = serializers.DateTimeField(read_only=True)
last_login = serializers.DateTimeField(read_only=True)
password = serializers.CharField(
write_only=True,
Expand All @@ -450,6 +451,7 @@ class Meta:
"first_name",
"last_name",
"email",
"date_joined",
"last_login",
"is_active",
"is_superuser",
Expand Down
1 change: 1 addition & 0 deletions dojo/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2977,6 +2977,7 @@ class UserFilter(DojoFilter):
('email', 'email'),
('is_active', 'is_active'),
('is_superuser', 'is_superuser'),
('date_joined', 'date_joined'),
('last_login', 'last_login'),
),
field_labels={
Expand Down
2 changes: 2 additions & 0 deletions dojo/templates/dojo/users.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ <h3 class="has-filters">
{% comment %} The display field is translated in the function. No need to translate here as well{% endcomment %}
<th class="nowrap, text-center">{% dojo_sort request superuser 'is_superuser' %}</th>
<th class="nowrap">{% trans "Global Role" %}</th>
<th class="nowrap">{% trans "Date Joined" %}</th>
<th class="nowrap">{% trans "Last Login" %}</th>
{% block users_table_extra_header_rows %}
{% endblock users_table_extra_header_rows %}
Expand Down Expand Up @@ -124,6 +125,7 @@ <h3 class="has-filters">
<i class="text-success fa-solid fa-check"></i>{% else %}
<i class="text-danger fa-solid fa-xmark"></i>{% endif %}</td>
<td>{% if u.global_role.role %} {{ u.global_role.role }} {% endif %}</td>
<td>{{ u.date_joined }}</td>
<td>{% if u.last_login %}{{ u.last_login }}{% else %}{% trans "Never" %}{% endif %}</td>
{% block users_table_extra_data_rows %}
{% endblock users_table_extra_data_rows %}
Expand Down
4 changes: 4 additions & 0 deletions dojo/templates/dojo/view_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ <h3 class="panel-title"><span class="fa-solid fa-circle-info fa-fw" aria-hidden=
<td style="width: 200px;"><strong>{% trans "Global role" %}</strong></td>
<td>{% if user.global_role.role %} {{ user.global_role.role }} {% endif %}</td>
</tr>
<tr>
<td style="width: 200px;"><strong>{% trans "Date Joined" %}</strong></td>
<td>{{ user.date_joined }}</td>
</tr>
<tr>
<td style="width: 200px;"><strong>{% trans "Last Login" %}</strong></td>
<td>{% if user.last_login %} {{ user.last_login }} {% else %} {% trans "Never" %} {% endif %}</td>
Expand Down

0 comments on commit a8ef36e

Please sign in to comment.