Skip to content

Commit aa0b1d3

Browse files
committed
resolve comments
1 parent f6acb42 commit aa0b1d3

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

app/eventyay/base/migrations/0005_user_is_wikimedia_user.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ class Migration(migrations.Migration):
1313
name='is_wikimedia_user',
1414
field=models.BooleanField(default=False, verbose_name='Is Wikimedia user'),
1515
),
16+
migrations.AlterField(
17+
model_name='user',
18+
name='wikimedia_username',
19+
field=models.CharField(max_length=255, blank=True, null=True, unique=True, verbose_name='Wikimedia username'),
20+
),
1621
]

app/eventyay/base/models/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class UserType(models.TextChoices):
164164
unique=True, db_index=True, null=True, blank=True, verbose_name=_('E-mail'), max_length=190
165165
)
166166
fullname = models.CharField(max_length=255, blank=True, null=True, verbose_name=_('Full name'))
167-
wikimedia_username = models.CharField(max_length=255, blank=True, null=True, verbose_name=_('Wikimedia username'))
167+
wikimedia_username = models.CharField(max_length=255, blank=True, null=True, unique=True, verbose_name=_('Wikimedia username'))
168168
is_wikimedia_user = models.BooleanField(default=False, verbose_name=_('Is Wikimedia user'))
169169
is_active = models.BooleanField(default=True, verbose_name=_('Is active'))
170170
is_staff = models.BooleanField(default=False, verbose_name=_('Is site admin'))

app/eventyay/presale/forms/checkout.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ def clean(self):
9999
if self.request and self.request.user and is_wikimedia_user(self.request.user):
100100
return cleaned_data
101101

102-
# For non-Wikimedia users, validate email is provided
103-
if not cleaned_data.get('email'):
104-
raise ValidationError(_('Email is required'))
105-
102+
# Validate email_repeat matches email if both are provided
106103
if (
107104
self.event.settings.order_email_asked_twice
108105
and self.cleaned_data.get('email')

0 commit comments

Comments
 (0)