small review changes

This commit is contained in:
Lukas Bockstaller
2026-02-20 17:51:52 +01:00
parent 14b2c84627
commit 4f02b607e5
3 changed files with 6 additions and 7 deletions
+4 -5
View File
@@ -19,8 +19,7 @@
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see # You should have received a copy of the GNU Affero General Public License along with this program. If not, see
# <https://www.gnu.org/licenses/>. # <https://www.gnu.org/licenses/>.
# #
from django.db.models import Prefetch from django import forms
from django.forms import ChoiceField, EmailField, ValidationError
from django.urls import reverse from django.urls import reverse
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django_scopes.forms import SafeModelChoiceField from django_scopes.forms import SafeModelChoiceField
@@ -35,7 +34,7 @@ from pretix.control.forms.widgets import Select2
class WaitingListEntryEditForm(I18nModelForm): class WaitingListEntryEditForm(I18nModelForm):
itemvar = ChoiceField( itemvar = forms.ChoiceField(
error_messages={ error_messages={
'invalid_choice': _("Select a valid choice.") 'invalid_choice': _("Select a valid choice.")
} }
@@ -116,7 +115,7 @@ class WaitingListEntryEditForm(I18nModelForm):
cleaned_data = super().clean() cleaned_data = super().clean()
if self.instance.voucher is not None: if self.instance.voucher is not None:
raise ValidationError(_('A voucher for this waiting list entry was already sent out.')) raise forms.ValidationError(_('A voucher for this waiting list entry was already sent out.'))
itemvar = cleaned_data.get('itemvar') itemvar = cleaned_data.get('itemvar')
if itemvar: if itemvar:
@@ -140,7 +139,7 @@ class WaitingListEntryEditForm(I18nModelForm):
] ]
field_classes = { field_classes = {
'subevent': SafeModelChoiceField, 'subevent': SafeModelChoiceField,
'email': EmailField, 'email': forms.EmailField,
'phone': PhoneNumberField, 'phone': PhoneNumberField,
} }
widgets = { widgets = {
@@ -26,7 +26,7 @@
{% trans "Cancel" %} {% trans "Cancel" %}
</a> </a>
<button type="submit" class="btn btn-primary btn-save"> <button type="submit" class="btn btn-primary btn-save">
{% trans "Submit" %} {% trans "Save" %}
</button> </button>
</div> </div>
</form> </form>
@@ -270,7 +270,7 @@
</button> </button>
<a href="{% url "control:event.orders.waitinglist.edit" organizer=request.event.organizer.slug event=request.event.slug entry=e.id %}" <a href="{% url "control:event.orders.waitinglist.edit" organizer=request.event.organizer.slug event=request.event.slug entry=e.id %}"
class="btn btn-default btn-sm" title="{% trans "Edit entry" context "subevent" %}" class="btn btn-default btn-sm" title="{% trans "Edit entry" %}"
data-toggle="tooltip"> data-toggle="tooltip">
<i class="fa fa-edit" aria-hidden="true"></i> <i class="fa fa-edit" aria-hidden="true"></i>
</a> </a>