Explorer
/proc/71/root/tmp/patch_ui_approval.py
← Zurück ↓ Download
from pathlib import Path
p=Path('/opt/struktur/social-media-agent/templates/publication_packages.html'); s=p.read_text()
old="""      <div class="pp-meta">Technische QA: {% if p.qa_status == 'passed' %}technisch geprüft{% elif p.qa_status == 'failed' %}technisch abgelehnt{% else %}noch nicht geprüft{% endif %}</div>"""
new=old+"\n      {% if p.human_visual_approval %}<div class=\"pp-meta\">Visuelle Freigabe: {{ p.human_visual_approval }}</div>{% endif %}"
assert s.count(old)==1
p.write_text(s.replace(old,new)); print('approval display added')