forked from CGM_Public/pretix_original
Event settings: Workaround for Django 5.2 change (#6025)
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations under the License.
|
# License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
|
from dataclasses import dataclass
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
from zoneinfo import ZoneInfo
|
from zoneinfo import ZoneInfo
|
||||||
@@ -578,6 +579,12 @@ class EventSettingsValidationMixin:
|
|||||||
del self.cleaned_data[field]
|
del self.cleaned_data[field]
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class FontOption:
|
||||||
|
title: str
|
||||||
|
data: str
|
||||||
|
|
||||||
|
|
||||||
class EventSettingsForm(EventSettingsValidationMixin, FormPlaceholderMixin, SettingsForm):
|
class EventSettingsForm(EventSettingsValidationMixin, FormPlaceholderMixin, SettingsForm):
|
||||||
timezone = forms.ChoiceField(
|
timezone = forms.ChoiceField(
|
||||||
choices=((a, a) for a in common_timezones),
|
choices=((a, a) for a in common_timezones),
|
||||||
@@ -729,7 +736,7 @@ class EventSettingsForm(EventSettingsValidationMixin, FormPlaceholderMixin, Sett
|
|||||||
del self.fields['event_list_filters']
|
del self.fields['event_list_filters']
|
||||||
del self.fields['event_calendar_future_only']
|
del self.fields['event_calendar_future_only']
|
||||||
self.fields['primary_font'].choices = [('Open Sans', 'Open Sans')] + sorted([
|
self.fields['primary_font'].choices = [('Open Sans', 'Open Sans')] + sorted([
|
||||||
(a, {"title": a, "data": v}) for a, v in get_fonts(self.event, pdf_support_required=False).items()
|
(a, FontOption(title=a, data=v)) for a, v in get_fonts(self.event, pdf_support_required=False).items()
|
||||||
], key=lambda a: a[0])
|
], key=lambda a: a[0])
|
||||||
|
|
||||||
# create "virtual" fields for better UX when editing <name>_asked and <name>_required fields
|
# create "virtual" fields for better UX when editing <name>_asked and <name>_required fields
|
||||||
|
|||||||
Reference in New Issue
Block a user