Misleading category.created signal

I noticed that in Indico signals.category.updated is signals.category.created.
This implies that you cannot distinguish from a newly created category from an update to an existing category.
Considering that the commit is 5 years old, and hopefully no one had an issue with it, I’m wondering if there is a purpose to have converged category.created and category.updated in the same signal.
If this is the case, what can you suggest instead of reading the stack at runtime looking at how the signal is actually invoked?

It’s not the same signal, just a typo (in the signal name which AFAIK has no real significance when using the values returned by signal() like we always do). I just pushed a fix that renames it to updated.

1 Like

well, if I run from indico shell:

In [1]: from indico.core import signals

In [2]: signals.category.created is signals.category.updated
Out[2]: True

It might be a typo, but a NamedSignal must be unique, otherwise, behaving as a singleton, two signals in the same namespace with the same name is the same object
BTW, Thank you

Interesting… I guess they do some magic in the signal function in order to return an existing one with the specified name.

I guess we never noticed it since we aren’t using these signals at all, they are just there because we thought someone might find them useful.