Skip to content

Commit

Permalink
Add validation_status info
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Jul 5, 2023
1 parent 9017f2b commit 5f0b6b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/management/commands/detect_broken_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def detect_question_broken_links(self):
{
"object_type": "Question",
"object_id": object.id,
"object_validation_status": object.validation_status,
"object_field_name": object_url_field,
"object_field_url": url,
}
Expand Down Expand Up @@ -74,6 +75,7 @@ def detect_quiz_broken_links(self):
{
"object_type": "Quiz",
"object_id": object.id,
"object_validation_status": object.validation_status,
"object_field_name": object_url_field,
"object_field_url": url,
}
Expand All @@ -90,11 +92,9 @@ def send_recap_email(self, error_list):

email_template_html = f"<!DOCTYPE html><html><h1>{COMMAND_TITLE}</h1>"
email_template_html += f"<p>{len(error_list)} liens cassés</p>"
email_template_html += (
"<table><thead><tr><th>Type</th><th>ID</th><th>Nom du champ</th><th>Lien cassé</th></tr></thead><tbody>"
)
email_template_html += "<table><thead><tr><th>Type</th><th>ID</th><th>Statut</th><th>Nom du champ</th><th>Lien cassé</th></tr></thead><tbody>" # noqa
for error in error_list:
email_template_html += f"<tr><td>{error['object_type']}</td><td>{error['object_id']}</td><td>{error['object_field_name']}</td><td>{error['object_field_url']}</td></tr>" # noqa
email_template_html += f"<tr><td>{error['object_type']}</td><td>{error['object_id']}</td><td>{error['object_validation_status']}</td><td>{error['object_field_name']}</td><td>{error['object_field_url']}</td></tr>" # noqa
email_template_html += "</tbody></table></html>"

send_mail(
Expand Down

0 comments on commit 5f0b6b3

Please sign in to comment.