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
Merged

Conversation

@bpedersen2
Copy link
Contributor

@bpedersen2 bpedersen2 commented Nov 21, 2017

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

@ThiefMaster ThiefMaster commented Nov 21, 2017

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

This comment has been minimized.

@ThiefMaster

ThiefMaster Nov 21, 2017
Member

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.

This comment has been minimized.

@bpedersen2

bpedersen2 Nov 21, 2017
Author Contributor

Done

@bpedersen2 bpedersen2 force-pushed the bpedersen2:checkin-signal branch from 2715fab to 5bb750c Nov 21, 2017
@@ -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)

This comment has been minimized.

@ThiefMaster

ThiefMaster Nov 21, 2017
Member

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

@ThiefMaster ThiefMaster commented Nov 21, 2017

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`)
@ThiefMaster ThiefMaster added this to the v2.1 milestone Nov 21, 2017
@bpedersen2 bpedersen2 force-pushed the bpedersen2:checkin-signal branch from 5bb750c to d0c0e58 Nov 22, 2017
@bpedersen2
Copy link
Contributor Author

@bpedersen2 bpedersen2 commented Nov 22, 2017

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

This comment has been minimized.

@ThiefMaster

ThiefMaster Nov 22, 2017
Member

there shouldn't be an empty line before this one (see the structure of the rest of the file)

This comment has been minimized.

@bpedersen2

bpedersen2 Dec 4, 2017
Author Contributor

Should be fixed

@bpedersen2 bpedersen2 force-pushed the bpedersen2:checkin-signal branch from d0c0e58 to 29df8e3 Nov 22, 2017
@bpedersen2 bpedersen2 force-pushed the bpedersen2:checkin-signal branch from 29df8e3 to 4f26184 Dec 15, 2017
@ThiefMaster ThiefMaster changed the base branch from v2.1-dev to master Jan 12, 2018
bpedersen2 added 3 commits Nov 21, 2017
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 ThiefMaster force-pushed the bpedersen2:checkin-signal branch from 4f26184 to b93f600 Jan 29, 2018
@ThiefMaster ThiefMaster merged commit b93f600 into indico:master Jan 29, 2018
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@ThiefMaster
Copy link
Member

@ThiefMaster ThiefMaster commented Jan 29, 2018

thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants