mirror of
https://github.com/pretix/pretix.git
synced 2026-05-14 16:44:06 +00:00
switch to core question type labels instead of defining our own strings
This commit is contained in:
@@ -529,19 +529,3 @@ def get_enum_opts(q):
|
||||
return [(opt.identifier, opt.answer) for opt in q.options.all()]
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
QUESTION_TYPE_IDENTIFIERS = {
|
||||
Question.TYPE_NUMBER: "NUMBER",
|
||||
Question.TYPE_STRING: "STRING",
|
||||
Question.TYPE_TEXT: "TEXT",
|
||||
Question.TYPE_BOOLEAN: "BOOLEAN",
|
||||
Question.TYPE_CHOICE: "CHOICE",
|
||||
Question.TYPE_CHOICE_MULTIPLE: "CHOICE_MULTIPLE",
|
||||
Question.TYPE_FILE: "FILE",
|
||||
Question.TYPE_DATE: "DATE",
|
||||
Question.TYPE_TIME: "TIME",
|
||||
Question.TYPE_DATETIME: "DATETIME",
|
||||
Question.TYPE_COUNTRYCODE: "COUNTRYCODE",
|
||||
Question.TYPE_PHONENUMBER: "PHONENUMBER",
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ from django import forms
|
||||
from django.forms import formset_factory
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from pretix.base.datasync.sourcefields import QUESTION_TYPE_IDENTIFIERS
|
||||
from pretix.base.models import Question
|
||||
from pretix.base.models.datasync import (
|
||||
MODE_APPEND_LIST, MODE_OVERWRITE, MODE_SET_IF_EMPTY, MODE_SET_IF_NEW,
|
||||
)
|
||||
@@ -118,7 +118,7 @@ class PropertyMappingFormSet(formset_factory(
|
||||
|
||||
def pretix_fields_choices(pretix_fields, initial_choice):
|
||||
return [
|
||||
(f.key, f.label + " [" + QUESTION_TYPE_IDENTIFIERS[f.type] + "]")
|
||||
(f.key, f.label + " [" + Question.TYPE_CHOICES[f.type] + "]")
|
||||
for f in pretix_fields
|
||||
if not f.deprecated or f.key == initial_choice
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user