Enhancement: include owner username in post-consumption variables (#7270)

This commit is contained in:
Freddy0
2024-07-17 00:23:29 +02:00
committed by GitHub
parent aef387ed69
commit 8e3ca37b05
3 changed files with 5 additions and 0 deletions

View File

@@ -450,6 +450,9 @@ class ConsumerPlugin(
"document-thumb",
kwargs={"pk": document.pk},
)
script_env["DOCUMENT_OWNER"] = (
document.owner.get_username() if document.owner else ""
)
script_env["DOCUMENT_CORRESPONDENT"] = str(document.correspondent)
script_env["DOCUMENT_TAGS"] = str(
",".join(document.tags.all().values_list("name", flat=True)),