mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Add "attention" flag to products
This commit is contained in:
@@ -42,7 +42,7 @@ class ItemSerializer(I18nAwareModelSerializer):
|
||||
'default_price', 'free_price', 'tax_rate', 'tax_rule', 'admission',
|
||||
'position', 'picture', 'available_from', 'available_until',
|
||||
'require_voucher', 'hide_without_voucher', 'allow_cancel',
|
||||
'min_per_order', 'max_per_order', 'has_variations',
|
||||
'min_per_order', 'max_per_order', 'checkin_attention', 'has_variations',
|
||||
'variations', 'addons')
|
||||
|
||||
|
||||
|
||||
38
src/pretix/base/migrations/0074_auto_20170825_1258.py
Normal file
38
src/pretix/base/migrations/0074_auto_20170825_1258.py
Normal file
File diff suppressed because one or more lines are too long
@@ -159,6 +159,8 @@ class Item(LoggedModel):
|
||||
:type max_per_order: int
|
||||
:param min_per_order: Minimum number of times this item needs to be in an order if bought at all. None for unlimited.
|
||||
:type min_per_order: int
|
||||
:param checkin_attention: Requires special attention at checkin
|
||||
:type checkin_attention: bool
|
||||
"""
|
||||
|
||||
event = models.ForeignKey(
|
||||
@@ -266,6 +268,13 @@ class Item(LoggedModel):
|
||||
'empty or set it to 0, there is no special limit for this product. The limit for the maximum '
|
||||
'number of items in the whole order applies regardless.')
|
||||
)
|
||||
checkin_attention = models.BooleanField(
|
||||
verbose_name=_('Requires special attention'),
|
||||
default=False,
|
||||
help_text=_('If you set this, the check-in app will show a visible warning that this ticket requires special '
|
||||
'attention. You can use this for example for student tickets to indicate to the person at '
|
||||
'check-in that the student ID card still needs to be checked.')
|
||||
)
|
||||
# !!! Attention: If you add new fields here, also add them to the copying code in
|
||||
# pretix/control/views/item.py if applicable.
|
||||
|
||||
|
||||
@@ -194,6 +194,7 @@ class ItemCreateForm(I18nModelForm):
|
||||
self.instance.allow_cancel = self.cleaned_data['copy_from'].allow_cancel
|
||||
self.instance.min_per_order = self.cleaned_data['copy_from'].min_per_order
|
||||
self.instance.max_per_order = self.cleaned_data['copy_from'].max_per_order
|
||||
self.instance.checkin_attention = self.cleaned_data['copy_from'].checkin_attention
|
||||
self.instance.position = (self.event.items.aggregate(p=Max('position'))['p'] or 0) + 1
|
||||
|
||||
instance = super().save(*args, **kwargs)
|
||||
@@ -283,6 +284,7 @@ class ItemUpdateForm(I18nModelForm):
|
||||
'allow_cancel',
|
||||
'max_per_order',
|
||||
'min_per_order',
|
||||
'checkin_attention'
|
||||
]
|
||||
widgets = {
|
||||
'available_from': forms.DateTimeInput(attrs={'class': 'datetimepicker'}),
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
{% bootstrap_field form.hide_without_voucher layout="horizontal" %}
|
||||
{% bootstrap_field form.allow_cancel layout="horizontal" %}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{% trans "Check-in" %}</legend>
|
||||
{% bootstrap_field form.checkin_attention layout="horizontal" %}
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-xs-12 col-lg-2">
|
||||
<div class="panel panel-default">
|
||||
|
||||
@@ -178,6 +178,7 @@ def serialize_op(op):
|
||||
'variation': str(op.variation) if op.variation else None,
|
||||
'variation_id': op.variation_id,
|
||||
'attendee_name': name,
|
||||
'attention': op.item.checkin_attention,
|
||||
'redeemed': bool(op.checkin_cnt),
|
||||
'paid': op.order.status == Order.STATUS_PAID,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user