From 931f78d7c23648b06ccb1403e4d0ec222ace7882 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 15 Oct 2021 14:26:07 -0700 Subject: [PATCH 1/2] Validate author page html --- bookwyrm/tests/views/test_author.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bookwyrm/tests/views/test_author.py b/bookwyrm/tests/views/test_author.py index 7a0065c9..03c027fa 100644 --- a/bookwyrm/tests/views/test_author.py +++ b/bookwyrm/tests/views/test_author.py @@ -9,6 +9,7 @@ from django.test.client import RequestFactory from bookwyrm import forms, models, views from bookwyrm.activitypub import ActivitypubResponse +from bookwyrm.tests.validate_html import validate_html class AuthorViews(TestCase): @@ -54,7 +55,7 @@ class AuthorViews(TestCase): is_api.return_value = False result = view(request, author.id) self.assertIsInstance(result, TemplateResponse) - result.render() + validate_html(result.render()) self.assertEqual(result.status_code, 200) self.assertEqual(result.status_code, 200) @@ -75,7 +76,7 @@ class AuthorViews(TestCase): result = view(request, author.id) self.assertIsInstance(result, TemplateResponse) - result.render() + validate_html(result.render()) self.assertEqual(result.status_code, 200) self.assertEqual(result.status_code, 200) From 1e7b56cdb0a7dfc8aae28436b249e6f153050d8c Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 15 Oct 2021 14:26:16 -0700 Subject: [PATCH 2/2] Don't show last edited by link if it's not set --- bookwyrm/templates/author/edit_author.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bookwyrm/templates/author/edit_author.html b/bookwyrm/templates/author/edit_author.html index 103341bf..54d7f4f1 100644 --- a/bookwyrm/templates/author/edit_author.html +++ b/bookwyrm/templates/author/edit_author.html @@ -12,7 +12,9 @@

{% trans "Added:" %} {{ author.created_date | naturaltime }}

{% trans "Updated:" %} {{ author.updated_date | naturaltime }}

+ {% if author.last_edited_by %}

{% trans "Last edited by:" %} {{ author.last_edited_by.display_name }}

+ {% endif %}