Fix #630 -- manual check-in of attendees (#642)

* [WIP] manual check-in of attendees

This enables manual check-in of attendees.  The post-code was heavily
copied from the APIRedeemView of the pretixdroid, thus so far this seems
to be working, but I have a few questions:

The checkin-Objects generated by the pretixdroid-app have a nonce.
Should the checkin object generated here have a nonce, too?

Should the result of the check-in be noted in any other way than by the
change of the status?

* addressed review comments

* implement unit test for manual checkin

* fix style-issues

* Slight layout change

* Log who did the manual check-in

* Improve unit test to check the result of the action
This commit is contained in:
Jakob Schnell
2017-10-28 23:16:22 +02:00
committed by Raphael Michel
parent 9213a40219
commit 1a894d71b8
4 changed files with 74 additions and 3 deletions

View File

@@ -5,8 +5,8 @@ import pytest
from django.utils.timezone import now
from pretix.base.models import (
Checkin, Event, Item, ItemAddOn, ItemCategory, Order, OrderPosition,
Organizer, Team, User,
Checkin, Event, Item, ItemAddOn, ItemCategory, LogEntry, Order,
OrderPosition, Organizer, Team, User,
)
from pretix.control.views.dashboards import checkin_widget
@@ -269,6 +269,19 @@ def test_checkins_list_mixed(client, checkin_list_env, query, expected):
assert item_keys == expected
@pytest.mark.django_db
def test_manual_checkins(client, checkin_list_env):
client.login(email='dummy@dummy.dummy', password='dummy')
assert not checkin_list_env[5][3].checkins.exists()
client.post('/control/event/dummy/dummy/checkins/', {
'checkin': [checkin_list_env[5][3].pk]
})
assert checkin_list_env[5][3].checkins.exists()
assert LogEntry.objects.filter(
action_type='pretix.control.views.checkin', object_id=checkin_list_env[5][3].order.pk
).exists()
@pytest.fixture
def checkin_list_with_addon_env():
# permission