Check-in: Show more information (#3576)

* Check-in: Show more information

* Add change notes

* Rebase migration

* Add "expand" option to checkinrpc

* REmove accidental file

* Docs fixes

* REbase migration

* Rebase migration

* Fix typo

* REbase migration

* Make web-checkin look more like new android checkin
This commit is contained in:
Raphael Michel
2023-11-28 14:52:12 +01:00
committed by GitHub
parent ab28086779
commit 8a3b313cb6
35 changed files with 346 additions and 41 deletions

View File

@@ -471,6 +471,21 @@ def test_require_product(token_client, organizer, clist, event, order):
assert resp.data['reason'] == 'product'
@pytest.mark.django_db
def test_checkin_texts(token_client, organizer, clist, event, order):
with scopes_disabled():
p = order.positions.first()
p.item.checkin_text = 'A'
p.item.save()
order.checkin_text = 'B'
order.save()
resp = _redeem(token_client, organizer, clist, p.secret, {})
assert resp.status_code == 201
assert resp.data['status'] == 'ok'
assert resp.data['checkin_texts'] == ['B', 'A']
@pytest.mark.django_db
def test_require_paid(token_client, organizer, clist, event, order):
with scopes_disabled():
@@ -683,6 +698,19 @@ def test_question_upload(token_client, organizer, clist, event, order, question)
assert order.positions.first().answers.get(question=question[0]).file
@pytest.mark.django_db
def test_question_expand(token_client, organizer, clist, event, order, question):
with scopes_disabled():
p = order.positions.first()
question[0].save()
p.answers.create(question=question[0], answer="3")
resp = _redeem(token_client, organizer, clist, p.secret, {"answers": {question[0].pk: ""}}, query="?expand=answers.question")
assert resp.status_code == 201
assert resp.data["status"] == "ok"
assert resp.data["position"]["answers"][0]["question"]["question"]["en"] == "Size"
@pytest.mark.django_db
def test_store_failed(token_client, organizer, clist, event, order):
with scopes_disabled():

View File

@@ -279,6 +279,7 @@ TEST_ITEM_RES = {
"hidden_if_available": None,
"hidden_if_item_available": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": False,
"require_approval": False,
"variations": [],
@@ -392,6 +393,7 @@ def test_item_detail_variations(token_client, organizer, event, team, item):
"description": None,
"position": 0,
"checkin_attention": False,
"checkin_text": None,
"require_approval": False,
"require_membership": False,
"require_membership_hidden": False,
@@ -478,6 +480,7 @@ def test_item_create(token_client, organizer, event, item, category, taxrule, me
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"has_variations": True,
"require_membership_types": [membership_type.pk],
"meta_data": {
@@ -556,6 +559,7 @@ def test_item_create_with_variation(token_client, organizer, event, item, catego
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"variations": [
{
@@ -566,6 +570,7 @@ def test_item_create_with_variation(token_client, organizer, event, item, catego
"active": True,
"require_approval": True,
"checkin_attention": False,
"checkin_text": None,
"require_membership": False,
"require_membership_hidden": False,
"require_membership_types": [],
@@ -618,6 +623,7 @@ def test_item_create_giftcard_validation(token_client, organizer, event, item, c
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"addons": []
},
@@ -650,6 +656,7 @@ def test_item_create_giftcard_validation(token_client, organizer, event, item, c
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"addons": []
},
@@ -687,6 +694,7 @@ def test_item_create_with_addon(token_client, organizer, event, item, category,
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"addons": [
{
@@ -733,6 +741,7 @@ def test_item_create_with_addon(token_client, organizer, event, item, category,
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"addons": [
{
@@ -777,6 +786,7 @@ def test_item_create_with_addon(token_client, organizer, event, item, category,
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"addons": [
{
@@ -821,6 +831,7 @@ def test_item_create_with_addon(token_client, organizer, event, item, category,
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"addons": [
{
@@ -873,6 +884,7 @@ def test_item_create_with_bundle(token_client, organizer, event, item, category,
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"bundles": [
{
@@ -919,6 +931,7 @@ def test_item_create_with_bundle(token_client, organizer, event, item, category,
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"bundles": [
{
@@ -960,6 +973,7 @@ def test_item_create_with_bundle(token_client, organizer, event, item, category,
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"bundles": [
{
@@ -1190,6 +1204,7 @@ def test_item_file_upload(token_client, organizer, event, item):
"min_per_order": None,
"max_per_order": None,
"checkin_attention": False,
"checkin_text": None,
"has_variations": True,
"meta_data": {
"day": "Wednesday"
@@ -1307,6 +1322,7 @@ TEST_VARIATIONS_RES = {
"default_price": None,
"price": "23.00",
"checkin_attention": False,
"checkin_text": None,
"require_approval": False,
"require_membership": False,
"require_membership_hidden": False,
@@ -1329,6 +1345,7 @@ TEST_VARIATIONS_UPDATE = {
"position": 1,
"default_price": "20.0",
"checkin_attention": False,
"checkin_text": None,
"require_approval": False,
"require_membership": False,
"require_membership_hidden": False,
@@ -2056,6 +2073,7 @@ TEST_QUESTION_RES = {
"required": False,
"items": [],
"ask_during_checkin": False,
"show_during_checkin": False,
"hidden": False,
"print_on_invoice": False,
"identifier": "ABC",

View File

@@ -257,6 +257,7 @@ def test_order_update_allowed_fields(token_client, organizer, event, order):
'valid_if_pending': True,
'custom_followup_at': '2021-06-12',
'checkin_attention': True,
'checkin_text': 'foobar',
'email': 'foo@bar.com',
'phone': '+4962219999',
'locale': 'de',
@@ -280,6 +281,7 @@ def test_order_update_allowed_fields(token_client, organizer, event, order):
assert order.comment == 'Here is a comment'
assert order.custom_followup_at.isoformat() == '2021-06-12'
assert order.checkin_attention
assert order.checkin_text == 'foobar'
assert order.email == 'foo@bar.com'
assert order.phone == '+4962219999'
assert order.locale == 'de'
@@ -294,6 +296,7 @@ def test_order_update_allowed_fields(token_client, organizer, event, order):
assert order.all_logentries().get(action_type='pretix.event.order.comment')
assert order.all_logentries().get(action_type='pretix.event.order.custom_followup_at')
assert order.all_logentries().get(action_type='pretix.event.order.checkin_attention')
assert order.all_logentries().get(action_type='pretix.event.order.checkin_text')
assert order.all_logentries().get(action_type='pretix.event.order.contact.changed')
assert order.all_logentries().get(action_type='pretix.event.order.phone.changed')
assert order.all_logentries().get(action_type='pretix.event.order.locale.changed')

View File

@@ -392,6 +392,7 @@ def test_order_create_simulate(token_client, organizer, event, item, quota, ques
],
'downloads': [],
'checkin_attention': False,
'checkin_text': None,
'payments': [],
'refunds': [],
'require_approval': False,

View File

@@ -288,6 +288,7 @@ TEST_ORDER_RES = {
"comment": "",
"custom_followup_at": None,
"checkin_attention": False,
"checkin_text": None,
"invoice_address": {
"last_modified": "2017-12-01T10:00:00Z",
"is_business": False,