mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Fix #273 -- Set correct all order expiry times to the end of the day
This commit is contained in:
@@ -197,12 +197,12 @@ class PaymentSettingsForm(SettingsForm):
|
||||
label=_('Payment term in days'),
|
||||
help_text=_("The number of days after placing an order the user has to pay to preserve his reservation."),
|
||||
)
|
||||
payment_term_last = forms.DateTimeField(
|
||||
payment_term_last = forms.DateField(
|
||||
label=_('Last date of payments'),
|
||||
help_text=_("The last date any payments are accepted. This has precedence over the number of "
|
||||
"days configured above."),
|
||||
required=False,
|
||||
widget=forms.DateTimeInput(attrs={'class': 'datetimepicker'})
|
||||
widget=forms.DateInput(attrs={'class': 'datepickerfield'})
|
||||
)
|
||||
payment_term_weekdays = forms.BooleanField(
|
||||
label=_('Only end payment terms on weekdays'),
|
||||
|
||||
@@ -13,13 +13,14 @@ class ExtendForm(I18nModelForm):
|
||||
model = Order
|
||||
fields = ['expires']
|
||||
widgets = {
|
||||
'expires': forms.DateTimeInput(attrs={'class': 'datetimepicker'}),
|
||||
'expires': forms.DateInput(attrs={'class': 'datepickerfield'}),
|
||||
}
|
||||
|
||||
def clean(self):
|
||||
data = super().clean()
|
||||
if data['expires'] < now():
|
||||
raise ValidationError(_('The new expiry date needs to be in the future.'))
|
||||
data['expires'] = data['expires'].replace(hour=23, minute=59, second=59)
|
||||
return data
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from django.conf.urls import include, url
|
||||
|
||||
from pretix.control.views import (
|
||||
auth, dashboards, event, help, item, main, orders, organizer,
|
||||
user, vouchers,
|
||||
auth, dashboards, event, help, item, main, orders, organizer, user,
|
||||
vouchers,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
@@ -13,8 +13,7 @@ from django.views.generic import DetailView, ListView, TemplateView, View
|
||||
|
||||
from pretix.base.i18n import language
|
||||
from pretix.base.models import (
|
||||
CachedFile, CachedTicket, Invoice, Item, ItemVariation, Order,
|
||||
Quota,
|
||||
CachedFile, CachedTicket, Invoice, Item, ItemVariation, Order, Quota,
|
||||
)
|
||||
from pretix.base.services import tickets
|
||||
from pretix.base.services.export import export
|
||||
|
||||
Reference in New Issue
Block a user