nottinghamtec / PyRIGS

📅 A Django-based event booking system designed for use by TEC PA and Lighting, a 'Student Run Service' of the University of Nottingham Students Union
https://nottinghamtec.co.uk/
Other
25 stars 8 forks source link

More robust forum webhook handling required #608

Open FreneticScribbler opened 2 weeks ago

FreneticScribbler commented 2 weeks ago

So - I guess I made an assumption that nobody would remove the rig number from the automatically generated title from the 'add forum thread' button.

Clearly, I should never have relied on that assumption... Need to insert a hidden field with it in, or something (though I suppose this would still be user over writable). At the very least the code needs to more gracefully abort...

https://github.com/nottinghamtec/PyRIGS/blob/93762fe198b54d0d48c2715351ba042e4287bffb/RIGS/views/rigboard.py#L418

Whoops.

jb3 commented 2 weeks ago

Can we just regex for an event identifier in the title and do it that way?

I don't think we need to do much else smart, people can manually add a forum thread when editing the rig, if we want to we could search new post bodies for RIGS embeds?

Agree that it should gracefully handle.

This issue is manifesting as RIGS-29 in Sentry for those with access.

FreneticScribbler commented 2 weeks ago

Basing it on the embed would be better as people are much better trained to include that than to follow the sort-of-standardised 'rig number | rig title' format.

jerbzz commented 2 weeks ago

How would we deal with the case of multiple embeds of the same rig?

jb3 commented 2 weeks ago

I think only adding a URL in if there is not already a URL is probably the safest way to do it.

We can also constrain by forum area etc. and also only look at top level posts?

FreneticScribbler commented 2 weeks ago

Pretty sure I already setup the webhook to only fire on top level posts in #rig-info