~sircmpwn/hub.sr.ht

a4a14dfce96785e4bbb99a612d95863cc1508503 — Drew DeVault 17 days ago 775c07a 0.17.16
webhooks.py: we'll get this right eventually
1 files changed, 4 insertions(+), 6 deletions(-)

M hubsrht/blueprints/webhooks.py
M hubsrht/blueprints/webhooks.py => hubsrht/blueprints/webhooks.py +4 -6
@@ 427,12 427,10 @@ def todo_ticket(tracker_id):
            f"{participant_url} commented on " +
            f"<a href='{tracker.url()}'>{tracker.name}</a> todo")

        submitter = payload["submitter"]
        assert submitter['type'] in ['user', 'email']
        if submitter['type'] == 'user':
            event.external_details_plain = f"{submitter['canonical_name']} commented on {tracker.name} todo"
        elif submitter['type'] == 'email':
            event.external_details_plain = f"{submitter['name']} commented on {tracker.name} todo"
        if participant['type'] == 'user':
            event.external_details_plain = f"{participant['canonical_name']} commented on {tracker.name} todo"
        elif participant['type'] == 'email':
            event.external_details_plain = f"{participant['name']} commented on {tracker.name} todo"
        event.external_url = ticket_url

        db.session.add(event)