mirror of
https://github.com/pretix/pretix.git
synced 2026-05-15 16:54:00 +00:00
Compare commits
1 Commits
drop-secon
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52f3d02158 |
@@ -31,7 +31,6 @@ RUN apt-get update && \
|
||||
mkdir /etc/pretix && \
|
||||
mkdir /data && \
|
||||
useradd -ms /bin/bash -d /pretix -u 15371 pretixuser && \
|
||||
chmod 0755 /pretix && \
|
||||
echo 'pretixuser ALL=(ALL) NOPASSWD:SETENV: /usr/bin/supervisord' >> /etc/sudoers && \
|
||||
mkdir /static && \
|
||||
mkdir /etc/supervisord
|
||||
|
||||
@@ -91,7 +91,7 @@ dependencies = [
|
||||
"pyuca",
|
||||
"qrcode==8.2",
|
||||
"redis==7.4.*",
|
||||
"reportlab==4.4.*",
|
||||
"reportlab==4.5.*",
|
||||
"requests==2.32.*",
|
||||
"sentry-sdk==2.58.*",
|
||||
"sepaxml==2.7.*",
|
||||
|
||||
@@ -939,7 +939,7 @@ class BaseQuestionsForm(forms.Form):
|
||||
label=label, required=required,
|
||||
help_text=help_text,
|
||||
initial=_initial,
|
||||
widget=TimePickerWidget(without_seconds=True),
|
||||
widget=TimePickerWidget(time_format=get_format_without_seconds('TIME_INPUT_FORMATS')),
|
||||
)
|
||||
elif q.type == Question.TYPE_DATETIME:
|
||||
if not help_text:
|
||||
|
||||
@@ -43,10 +43,6 @@ from django.utils.timezone import get_current_timezone, now
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from pretix.helpers.format import PlainHtmlAlternativeString
|
||||
from pretix.helpers.i18n import (
|
||||
get_format_without_seconds, get_javascript_format,
|
||||
get_javascript_format_without_seconds,
|
||||
)
|
||||
|
||||
|
||||
def replace_arabic_numbers(inp):
|
||||
@@ -112,7 +108,7 @@ class DatePickerWidget(forms.DateInput):
|
||||
|
||||
|
||||
class TimePickerWidget(forms.TimeInput):
|
||||
def __init__(self, attrs=None, time_format=None, without_seconds=False):
|
||||
def __init__(self, attrs=None, time_format=None):
|
||||
attrs = attrs or {}
|
||||
if 'placeholder' in attrs:
|
||||
del attrs['placeholder']
|
||||
@@ -121,27 +117,8 @@ class TimePickerWidget(forms.TimeInput):
|
||||
time_attrs['class'] += ' timepickerfield'
|
||||
time_attrs['autocomplete'] = 'off'
|
||||
|
||||
if time_format or without_seconds:
|
||||
# Explicitly set data-format attributes for the JS layer instead of relying on the body-wide config
|
||||
def time_format_attr():
|
||||
if without_seconds:
|
||||
return get_javascript_format_without_seconds(time_format or "TIME_INPUT_FORMATS")
|
||||
return get_javascript_format(time_format or "TIME_INPUT_FORMATS")
|
||||
|
||||
time_attrs['data-format'] = lazy(time_format_attr, str)
|
||||
|
||||
def time_format_attr():
|
||||
if without_seconds:
|
||||
return get_javascript_format_without_seconds(time_format or "TIME_INPUT_FORMATS")
|
||||
return get_javascript_format(time_format or "TIME_INPUT_FORMATS")
|
||||
|
||||
time_attrs['data-format'] = lazy(time_format_attr, str)
|
||||
|
||||
def placeholder():
|
||||
if without_seconds:
|
||||
tf = time_format or get_format_without_seconds('TIME_INPUT_FORMATS')
|
||||
else:
|
||||
tf = time_format or get_format('TIME_INPUT_FORMATS')[0]
|
||||
tf = time_format or get_format('TIME_INPUT_FORMATS')[0]
|
||||
return now().replace(
|
||||
year=2000, month=1, day=1, hour=0, minute=0, second=0, microsecond=0
|
||||
).strftime(tf)
|
||||
@@ -205,7 +182,7 @@ class UploadedFileWidget(forms.ClearableFileInput):
|
||||
class SplitDateTimePickerWidget(forms.SplitDateTimeWidget):
|
||||
template_name = 'pretixbase/forms/widgets/splitdatetime.html'
|
||||
|
||||
def __init__(self, attrs=None, date_format=None, time_format=None, min_date=None, max_date=None, without_seconds=False):
|
||||
def __init__(self, attrs=None, date_format=None, time_format=None, min_date=None, max_date=None):
|
||||
attrs = attrs or {}
|
||||
if 'placeholder' in attrs:
|
||||
del attrs['placeholder']
|
||||
@@ -228,36 +205,14 @@ class SplitDateTimePickerWidget(forms.SplitDateTimeWidget):
|
||||
max_date if not isinstance(max_date, datetime) else max_date.astimezone(get_current_timezone()).date()
|
||||
).isoformat()
|
||||
|
||||
if date_format or time_format or without_seconds:
|
||||
# Explicitly set data-format attributes for the JS layer instead of relying on the body-wide config
|
||||
def date_format_attr():
|
||||
if without_seconds:
|
||||
return get_javascript_format_without_seconds(date_format or "DATE_INPUT_FORMATS")
|
||||
return get_javascript_format(date_format or "DATE_INPUT_FORMATS")
|
||||
|
||||
date_attrs['data-format'] = lazy(date_format_attr, str)
|
||||
|
||||
def time_format_attr():
|
||||
if without_seconds:
|
||||
return get_javascript_format_without_seconds(time_format or "TIME_INPUT_FORMATS")
|
||||
return get_javascript_format(time_format or "TIME_INPUT_FORMATS")
|
||||
|
||||
time_attrs['data-format'] = lazy(time_format_attr, str)
|
||||
|
||||
def date_placeholder():
|
||||
if without_seconds:
|
||||
df = date_format or get_format_without_seconds('DATE_INPUT_FORMATS')
|
||||
else:
|
||||
df = date_format or get_format('DATE_INPUT_FORMATS')[0]
|
||||
df = date_format or get_format('DATE_INPUT_FORMATS')[0]
|
||||
return now().replace(
|
||||
year=2000, month=12, day=31, hour=18, minute=0, second=0, microsecond=0
|
||||
).strftime(df)
|
||||
|
||||
def time_placeholder():
|
||||
if without_seconds:
|
||||
tf = time_format or get_format_without_seconds('TIME_INPUT_FORMATS')
|
||||
else:
|
||||
tf = time_format or get_format('TIME_INPUT_FORMATS')[0]
|
||||
tf = time_format or get_format('TIME_INPUT_FORMATS')[0]
|
||||
return now().replace(
|
||||
year=2000, month=1, day=1, hour=0, minute=0, second=0, microsecond=0
|
||||
).strftime(tf)
|
||||
|
||||
@@ -197,10 +197,10 @@ class EventWizardBasicsForm(I18nModelForm):
|
||||
'presale_end': SplitDateTimeField,
|
||||
}
|
||||
widgets = {
|
||||
'date_from': SplitDateTimePickerWidget(without_seconds=True),
|
||||
'date_to': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_basics-date_from_0'}, without_seconds=True),
|
||||
'presale_start': SplitDateTimePickerWidget(without_seconds=True),
|
||||
'presale_end': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_basics-presale_start_0'}, without_seconds=True),
|
||||
'date_from': SplitDateTimePickerWidget(),
|
||||
'date_to': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_basics-date_from_0'}),
|
||||
'presale_start': SplitDateTimePickerWidget(),
|
||||
'presale_end': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_basics-presale_start_0'}),
|
||||
'slug': SlugWidget,
|
||||
}
|
||||
|
||||
@@ -521,11 +521,11 @@ class EventUpdateForm(I18nModelForm):
|
||||
'limit_sales_channels': SafeModelMultipleChoiceField,
|
||||
}
|
||||
widgets = {
|
||||
'date_from': SplitDateTimePickerWidget(without_seconds=True),
|
||||
'date_to': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_date_from_0'}, without_seconds=True),
|
||||
'date_admission': SplitDateTimePickerWidget(attrs={'data-date-default': '#id_date_from_0'}, without_seconds=True),
|
||||
'presale_start': SplitDateTimePickerWidget(without_seconds=True),
|
||||
'presale_end': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_presale_start_0'}, without_seconds=True),
|
||||
'date_from': SplitDateTimePickerWidget(),
|
||||
'date_to': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_date_from_0'}),
|
||||
'date_admission': SplitDateTimePickerWidget(attrs={'data-date-default': '#id_date_from_0'}),
|
||||
'presale_start': SplitDateTimePickerWidget(),
|
||||
'presale_end': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_presale_start_0'}),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -770,7 +770,7 @@ class EventOrderExpertFilterForm(EventOrderFilterForm):
|
||||
)
|
||||
elif q.type == Question.TYPE_TIME:
|
||||
self.fields[fname] = forms.TimeField(
|
||||
widget=TimePickerWidget(without_seconds=True),
|
||||
widget=TimePickerWidget(time_format=get_format_without_seconds('TIME_INPUT_FORMATS')),
|
||||
help_text=_('Exact matches only'),
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
@@ -245,8 +245,8 @@ class QuestionForm(I18nModelForm):
|
||||
'valid_string_length_max',
|
||||
]
|
||||
widgets = {
|
||||
'valid_datetime_min': SplitDateTimePickerWidget(without_seconds=True),
|
||||
'valid_datetime_max': SplitDateTimePickerWidget(without_seconds=True),
|
||||
'valid_datetime_min': SplitDateTimePickerWidget(),
|
||||
'valid_datetime_max': SplitDateTimePickerWidget(),
|
||||
'valid_date_min': DatePickerWidget(),
|
||||
'valid_date_max': DatePickerWidget(),
|
||||
'items': forms.CheckboxSelectMultiple(
|
||||
@@ -1372,6 +1372,6 @@ class ItemProgramTimeForm(I18nModelForm):
|
||||
'end': forms.SplitDateTimeField,
|
||||
}
|
||||
widgets = {
|
||||
'start': SplitDateTimePickerWidget(without_seconds=True),
|
||||
'end': SplitDateTimePickerWidget(without_seconds=True),
|
||||
'start': SplitDateTimePickerWidget(),
|
||||
'end': SplitDateTimePickerWidget(),
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ from pretix.base.reldate import RelativeDateTimeField, RelativeDateWrapper
|
||||
from pretix.base.templatetags.money import money_filter
|
||||
from pretix.control.forms import SplitDateTimeField, SplitDateTimePickerWidget
|
||||
from pretix.control.forms.rrule import RRuleForm
|
||||
from pretix.helpers.i18n import get_javascript_format_without_seconds
|
||||
from pretix.helpers.money import change_decimal_field
|
||||
|
||||
|
||||
@@ -81,11 +80,11 @@ class SubEventForm(I18nModelForm):
|
||||
'presale_end': SplitDateTimeField,
|
||||
}
|
||||
widgets = {
|
||||
'date_from': SplitDateTimePickerWidget(without_seconds=True),
|
||||
'date_to': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_date_from_0'}, without_seconds=True),
|
||||
'date_admission': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_date_from_0'}, without_seconds=True),
|
||||
'presale_start': SplitDateTimePickerWidget(without_seconds=True),
|
||||
'presale_end': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_presale_start_0'}, without_seconds=True),
|
||||
'date_from': SplitDateTimePickerWidget(),
|
||||
'date_to': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_date_from_0'}),
|
||||
'date_admission': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_date_from_0'}),
|
||||
'presale_start': SplitDateTimePickerWidget(),
|
||||
'presale_end': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_presale_start_0'}),
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +162,7 @@ class SubEventBulkEditForm(I18nModelForm):
|
||||
self.fields[k + '_time'] = forms.TimeField(
|
||||
label=self._meta.model._meta.get_field(k).verbose_name,
|
||||
help_text=self._meta.model._meta.get_field(k).help_text,
|
||||
widget=TimePickerWidget(without_seconds=True),
|
||||
widget=TimePickerWidget(),
|
||||
required=False,
|
||||
)
|
||||
|
||||
@@ -507,12 +506,6 @@ class TimeForm(forms.Form):
|
||||
required=False
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields['time_from'].widget.attrs['data-format'] = get_javascript_format_without_seconds("TIME_INPUT_FORMATS")
|
||||
self.fields['time_to'].widget.attrs['data-format'] = get_javascript_format_without_seconds("TIME_INPUT_FORMATS")
|
||||
self.fields['time_admission'].widget.attrs['data-format'] = get_javascript_format_without_seconds("TIME_INPUT_FORMATS")
|
||||
|
||||
|
||||
TimeFormSet = formset_factory(
|
||||
TimeForm,
|
||||
|
||||
@@ -79,7 +79,6 @@ from pretix.control.views import PaginationMixin
|
||||
from pretix.control.views.event import MetaDataEditorMixin
|
||||
from pretix.helpers import GroupConcat
|
||||
from pretix.helpers.compat import CompatDeleteView
|
||||
from pretix.helpers.i18n import get_format_without_seconds
|
||||
from pretix.helpers.models import modelcopy
|
||||
|
||||
|
||||
@@ -804,7 +803,7 @@ class SubEventBulkCreate(SubEventEditorMixin, EventPermissionRequiredMixin, Asyn
|
||||
ctx['rrule_formset'] = self.rrule_formset
|
||||
ctx['time_formset'] = self.time_formset
|
||||
|
||||
tf = get_format_without_seconds('TIME_INPUT_FORMATS')
|
||||
tf = get_format('TIME_INPUT_FORMATS')[0]
|
||||
ctx['time_admission_sample'] = time(8, 30, 0).strftime(tf)
|
||||
ctx['time_begin_sample'] = time(9, 0, 0).strftime(tf)
|
||||
ctx['time_end_sample'] = time(18, 0, 0).strftime(tf)
|
||||
|
||||
@@ -265,7 +265,7 @@ EMAIL_USE_TLS = config.getboolean('mail', 'tls', fallback=False)
|
||||
EMAIL_USE_SSL = config.getboolean('mail', 'ssl', fallback=False)
|
||||
EMAIL_SUBJECT_PREFIX = '[pretix] '
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
EMAIL_CUSTOM_SMTP_BACKEND = 'pretix.base.email.CheckPrivateNetworkSmtpBackend'
|
||||
EMAIL_CUSTOM_SMTP_BACKEND = 'pretixbase.email.CheckPrivateNetworkSmtpBackend'
|
||||
EMAIL_TIMEOUT = 60
|
||||
|
||||
ADMINS = [('Admin', n) for n in config.get('mail', 'admins', fallback='').split(",") if n]
|
||||
|
||||
@@ -123,7 +123,7 @@ var form_handlers = function (el) {
|
||||
|
||||
el.find(".datetimepicker").each(function () {
|
||||
$(this).datetimepicker({
|
||||
format: $(this).attr("data-format") ? $(this).attr("data-format") : $("body").attr("data-datetimeformat"),
|
||||
format: $("body").attr("data-datetimeformat"),
|
||||
locale: $("body").attr("data-datetimelocale"),
|
||||
useCurrent: false,
|
||||
showClear: !$(this).prop("required"),
|
||||
@@ -146,7 +146,7 @@ var form_handlers = function (el) {
|
||||
|
||||
el.find(".datepickerfield").each(function () {
|
||||
var opts = {
|
||||
format: $(this).attr("data-format") ? $(this).attr("data-format") : $("body").attr("data-dateformat"),
|
||||
format: $("body").attr("data-dateformat"),
|
||||
locale: $("body").attr("data-datetimelocale"),
|
||||
useCurrent: false,
|
||||
showClear: !$(this).prop("required"),
|
||||
@@ -204,7 +204,7 @@ var form_handlers = function (el) {
|
||||
|
||||
el.find(".timepickerfield").each(function () {
|
||||
var opts = {
|
||||
format: $(this).attr("data-format") ? $(this).attr("data-format") : $("body").attr("data-timeformat"),
|
||||
format: $("body").attr("data-timeformat"),
|
||||
locale: $("body").attr("data-datetimelocale"),
|
||||
useCurrent: false,
|
||||
showClear: !$(this).prop("required"),
|
||||
|
||||
@@ -464,8 +464,6 @@ details.details-open .panel-title::before {
|
||||
.alert > dl:last-child,
|
||||
td > p:last-child,
|
||||
.panel-body > dl:last-child,
|
||||
.panel-body > ul:last-child,
|
||||
.panel-body > ol:last-child,
|
||||
.panel-body > .table:last-child,
|
||||
.panel-body > .table-responsive:last-child > .table:last-child,
|
||||
table td ul:last-child {
|
||||
|
||||
@@ -11,7 +11,7 @@ var form_handlers = function (el) {
|
||||
|
||||
el.find(".datetimepicker").each(function () {
|
||||
$(this).datetimepicker({
|
||||
format: $(this).attr("data-format") ? $(this).attr("data-format") : $("body").attr("data-datetimeformat"),
|
||||
format: $("body").attr("data-datetimeformat"),
|
||||
locale: $("body").attr("data-datetimelocale"),
|
||||
useCurrent: false,
|
||||
showClear: !$(this).prop("required"),
|
||||
@@ -34,7 +34,7 @@ var form_handlers = function (el) {
|
||||
|
||||
el.find(".datepickerfield").each(function () {
|
||||
var opts = {
|
||||
format: $(this).attr("data-format") ? $(this).attr("data-format") : $("body").attr("data-dateformat"),
|
||||
format: $("body").attr("data-dateformat"),
|
||||
locale: $("body").attr("data-datetimelocale"),
|
||||
useCurrent: false,
|
||||
showClear: !$(this).prop("required"),
|
||||
@@ -91,7 +91,7 @@ var form_handlers = function (el) {
|
||||
|
||||
el.find(".timepickerfield").each(function () {
|
||||
var opts = {
|
||||
format: $(this).attr("data-format") ? $(this).attr("data-format") : $("body").attr("data-timeformat"),
|
||||
format: $("body").attr("data-timeformat"),
|
||||
locale: $("body").attr("data-datetimelocale"),
|
||||
useCurrent: false,
|
||||
showClear: !$(this).prop("required"),
|
||||
|
||||
Reference in New Issue
Block a user