Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8c66a00
fix: update user email and fullname display defaults in admin templat…
gaumrab Nov 12, 2025
8f3b4fd
fix: handle None email values in UserEditForm to improve user experience
gaumrab Nov 12, 2025
9c1c9ec
Merge branch 'enext' into fix/user-none-email-display
mariobehling Nov 13, 2025
dc1956e
Merge branch 'enext' into fix/user-none-email-display
mariobehling Nov 13, 2025
f416461
fix(ui) unify navigation button styling across Tickets and Talk views…
ArnavBallinCode Nov 16, 2025
38f84d7
fix(ui): prevent sidebar auto-collapse on navigation (#1306)
ArnavBallinCode Nov 16, 2025
a6636c2
Chore: remove ticket/video URL fields (#1309)
Saksham-Sirohi Nov 16, 2025
30c28a8
remove logout button on video component (#1313)
Saksham-Sirohi Nov 16, 2025
b7856b5
PostgreSQL syntax error in Room permission query (#1314)
suhailnadaf509 Nov 16, 2025
7ca8ef7
fix unable to save config (#1295)
Saksham-Sirohi Nov 17, 2025
6266c3f
Refactored the entire system to replace all legacy 'pretix/pretalx' r…
ArnavBallinCode Nov 17, 2025
f1ba6a7
bug: enable browser timezone for orders and mails optimizing filters …
Saksham-Sirohi Nov 18, 2025
021c73b
chore(deps): update reportlab requirement from ==4.2.* to ==4.4.* (#1…
dependabot[bot] Nov 18, 2025
7e65d34
chore: remove duplicate orga settings (#1320)
Saksham-Sirohi Nov 18, 2025
a81a1e0
chore(deps): update stripe requirement from ==13.2.* to ==14.0.* (#1327)
dependabot[bot] Nov 19, 2025
018f1ac
chore(deps): update sentry-sdk requirement from ==2.44.* to ==2.45.* …
dependabot[bot] Nov 19, 2025
3963cc7
Resolve Sidebar Icon Layout Shift (#1319)
ArnavBallinCode Nov 20, 2025
4c92d7e
Fix: socialauth URLs were not resolved (#1324)
hongquan Nov 20, 2025
cd33fe8
Merge branch 'enext' into fix/user-none-email-display
mariobehling Nov 20, 2025
8cda595
chore: add translations korean and indonesian (#1330)
Saksham-Sirohi Nov 20, 2025
84dbee0
feature: added hidden rooms and ensure sync (#1184)
Saksham-Sirohi Nov 21, 2025
978e73a
chore(deps): update geoip2 requirement from ==4.* to ==5.* (#1333)
dependabot[bot] Nov 22, 2025
8d4d440
chore(deps): update redis requirement from ==7.0.* to ==7.1.* (#1329)
dependabot[bot] Nov 22, 2025
3efab3b
Fix: HTTP 500 error handling during room deletion (#1280)
ArnavBallinCode Nov 22, 2025
54f1945
Fix: gift card 500 error (#1260)
ArnavBallinCode Nov 22, 2025
ab3731d
Fix CSV Export Returns 500 Error (#1267)
prayag78 Nov 22, 2025
67d2ac5
Export orders with Wikimedia username (#1332)
hongquan Nov 22, 2025
0011de0
bug: image rescaling fix (#1292)
Saksham-Sirohi Nov 23, 2025
70a8496
fix(ui): match top menu bar between eventyay talk and eventyay ticket…
prayag78 Nov 23, 2025
2f3e282
Merge branch 'enext' into fix/user-none-email-display
mariobehling Nov 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions app/eventyay/control/forms/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,25 @@ class Meta:

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['email'].required = True
# Handle None email values - show empty field instead of "None" text
if self.instance and self.instance.pk and self.instance.email is None:
self.initial['email'] = ''
# Make email not required for existing users without email
self.fields['email'].required = False
else:
self.fields['email'].required = True
self.fields['last_login'].disabled = True
if self.instance and self.instance.auth_backend != 'native':
del self.fields['new_pw']
del self.fields['new_pw_repeat']
self.fields['email'].disabled = True

def clean_email(self):
email = self.cleaned_data['email']
email = self.cleaned_data.get('email', '').strip()
# Convert empty string to None for users without email
if not email:
Comment on lines +79 to +81
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Stripping whitespace from email may cause issues for legitimate emails with leading/trailing spaces.

Consider validating and rejecting emails with leading or trailing spaces, rather than silently removing them, to avoid masking user input errors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable. Please also show an error message for invalid emails.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your feedback!

To show an error message for invalid emails, you can enhance the clean_email method in your form to use Django's built-in email validation. This way, if a user enters an email with leading/trailing spaces or an invalid format, the form will display a clear error message.

Here's how you can update your clean_email method:

from django.core.validators import validate_email
from django.core.exceptions import ValidationError

    def clean_email(self):
        email = self.cleaned_data.get('email', '')
        if email:
            # Check for leading/trailing spaces
            if email != email.strip():
                raise forms.ValidationError(_('Email address must not have leading or trailing spaces.'), code='invalid')
            try:
                validate_email(email)
            except ValidationError:
                raise forms.ValidationError(_('Enter a valid email address.'), code='invalid')
        else:
            return None
        # Check for duplicate emails only if email is provided
        if User.objects.filter(Q(email__iexact=email) & ~Q(pk=self.instance.pk)).exists():
            raise forms.ValidationError(
                self.error_messages['duplicate_identifier'],
                code='duplicate_identifier',
            )
        return email

This will:

  • Reject emails with leading/trailing spaces and show a specific error
  • Use Django's email validator for format checking
  • Continue to check for duplicates as before

Let me know if you need a full patch or further help integrating this!

return None
# Check for duplicate emails only if email is provided
if User.objects.filter(Q(email__iexact=email) & ~Q(pk=self.instance.pk)).exists():
raise forms.ValidationError(
self.error_messages['duplicate_identifier'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load bootstrap3 %}
{% block title %}{% trans "User" %}{% endblock %}
{% block content %}
<h1>{% trans "User" %} {{ user.email }}</h1>
<h1>{% trans "User" %} {{ user.email|default:"—" }}</h1>
<p>
{% if user.auth_backend == "native" %}
<form action='{% url "eventyay_admin:admin.users.reset" id=user.pk %}' method="post" class="form-inline helper-display-inline">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ <h1>{% trans "Users" %}</h1>
{% for u in users %}
<tr>
<td><strong>
<a href='{% url "eventyay_admin:admin.users.edit" id=u.pk %}'>{{ u.email }}</a>
<a href='{% url "eventyay_admin:admin.users.edit" id=u.pk %}'>{{ u.email|default:"—" }}</a>
</strong></td>
<td>{{ u.fullname|default_if_none:"" }}</td>
<td>{{ u.fullname|default:"—" }}</td>
<td>{% if u.is_active %}<span class="fa fa-check-circle"></span>{% endif %}</td>
<td>{% if u.is_staff %}<span class="fa fa-check-circle"></span>{% endif %}</td>
<td class="text-right flip">
Expand Down