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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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)),