New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add signal for checkin state changed #3161
Conversation
You still need to actually send the signal ;) |
@@ -66,3 +66,8 @@ | |||
If this signal returns ``True``, the user will not be able to download | |||
their ticket. | |||
""") | |||
|
|||
registration_checkin_updated = _signals.signal('registration-checkin-updated', """ | |||
Called when the checkin state of registration changes. The `sender` is the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of a registration
(same typo in registration_state_updated
, feel free to fix it there too).
I'd also move your new signal below that one since they are kind of similar so I think it makes more sense to have it up there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
2715fab
to
5bb750c
Compare
@@ -57,6 +57,7 @@ def _process_PATCH(self): | |||
|
|||
if 'checked_in' in request.json: | |||
self._registration.checked_in = bool(request.json['checked_in']) | |||
signals.event.registration_checkin_updated(self._registration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test this? I don't think signals implement __call__
so you need to call .send()
on them:
signals.event.registration_checkin_updated.send(self._registration)
Please add a CHANGES.rst entry (in the "Internal Changes" section):
|
5bb750c
to
d0c0e58
Compare
Fixed the missing send and added changelog. The signal now arrives in a simple test plugin |
CHANGES.rst
Outdated
@@ -34,6 +34,9 @@ Internal Changes | |||
the ``can_manage`` method whose ``role`` argument has been renamed to | |||
``permission`` (:issue:`3057`) | |||
|
|||
- Add new ``registration_checkin_updated`` signal that can be used by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there shouldn't be an empty line before this one (see the structure of the rest of the file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed
d0c0e58
to
29df8e3
Compare
29df8e3
to
4f26184
Compare
This signal can be used e.g. in a plugin to print badges or further material on demand at a check-in desk. See https://talk.getindico.io/t/print-on-registration-plugin/99 for the discussion.
This is emitted only for explict checkin/checkout actions via the request handlers, not for db-bound operations such as cloning an event wiht registrations.
4f26184
to
b93f600
Compare
thanks! |
This signal can be used e.g. in a plugin to print badges or further
material on demand at a check-in desk.
See https://talk.getindico.io/t/print-on-registration-plugin/99 for
the discussion.