mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Show Subevent start time in select2-pickers (#1630)
* Add Subevent time to __str__ * Show subevent-dates in select2 picker * Show event-dateblock (if enabled) on Widget Voucher redemption page * Update src/pretix/base/models/event.py Co-Authored-By: Raphael Michel <michel@rami.io> * Update src/pretix/control/templates/pretixcontrol/vouchers/index.html Co-Authored-By: Raphael Michel <michel@rami.io> * Update src/pretix/control/views/typeahead.py Co-Authored-By: Raphael Michel <michel@rami.io> * Remove date-block on non-subevent voucher redemption pages Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
@@ -15,6 +15,7 @@ from django.db import models
|
||||
from django.db.models import Exists, F, OuterRef, Prefetch, Q, Subquery
|
||||
from django.template.defaultfilters import date as _date
|
||||
from django.utils.crypto import get_random_string
|
||||
from django.utils.formats import date_format
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.timezone import make_aware, now
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
@@ -1032,7 +1033,11 @@ class SubEvent(EventMixin, LoggedModel):
|
||||
ordering = ("date_from", "name")
|
||||
|
||||
def __str__(self):
|
||||
return '{} - {}'.format(self.name, self.get_date_range_display())
|
||||
return '{} - {} {}'.format(
|
||||
self.name,
|
||||
self.get_date_range_display(),
|
||||
date_format(self.date_from.astimezone(self.timezone), "TIME_FORMAT") if self.settings.show_times else ""
|
||||
).strip()
|
||||
|
||||
def free_seats(self, ignore_voucher=None, sales_channel='web', include_blocked=False):
|
||||
from .orders import CartPosition, Order, OrderPosition
|
||||
|
||||
Reference in New Issue
Block a user