Skip to content

Commit e562f5e

Browse files
committed
feat(admin): surface domain status in UI
Not the most beautiful, but good enough to start with. It was interesting to learn about the ability to reflect back some data from the underlying object through the form, thanks `unverify_reason`! Signed-off-by: Mike Fiedler <miketheman@gmail.com>
1 parent 8de75c1 commit e562f5e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

warehouse/admin/templates/admin/users/detail.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,22 @@ <h3 class="card-title">Emails</h3>
548548
</div>
549549
{% endif %}
550550
</div>
551+
<div class="row">
552+
<div class="col">
553+
Domain Status: {{ field.domain_last_status.data }}
554+
</div>
555+
<div class="col">
556+
Last checked: {{ field.domain_last_checked.data }}
557+
</div>
558+
{# TODO: Uncomment after implementing an admin route to run the check and flash, but needs to work for each email #}
559+
{# <div class="col">#}
560+
{# <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#checkDomainModal">#}
561+
{# <i class="fa-solid fa-magnifying-glass"></i>#}
562+
{# Check Domain Now #}
563+
{# </button>#}
564+
{# </div>#}
565+
</div>
566+
{% if not loop.last %}<hr />{% endif %}
551567
{% endfor %}
552568
</div>
553569

warehouse/admin/views/users.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ class EmailForm(wtforms.Form):
9898
verified = wtforms.fields.BooleanField()
9999
public = wtforms.fields.BooleanField()
100100
unverify_reason = wtforms.fields.StringField(render_kw={"readonly": True})
101+
domain_last_checked = wtforms.fields.DateTimeField(render_kw={"readonly": True})
102+
domain_last_status = wtforms.fields.StringField(render_kw={"readonly": True})
101103

102104

103105
class EmailsForm(wtforms.Form):

0 commit comments

Comments
 (0)