Skip to content
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

Merged
merged 3 commits into from Jan 29, 2018

Conversation

bpedersen2
Copy link
Contributor

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.

@ThiefMaster
Copy link
Member

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
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -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)
Copy link
Member

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)

@ThiefMaster
Copy link
Member

Please add a CHANGES.rst entry (in the "Internal Changes" section):

- Add new ``registration_checkin_updated`` signal that can be used by
  plugins to perform an action when the checkin state of a registration
  changes (:issue:`3161`, thanks :user:`bpedersen2`)

@bpedersen2
Copy link
Contributor Author

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
Copy link
Member

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed

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.
@ThiefMaster
Copy link
Member

thanks!

@bpedersen2 bpedersen2 deleted the checkin-signal branch January 29, 2018 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants