Skip to content

Commit

Permalink
Fix users not showing up in attendee lists (#3171)
Browse files Browse the repository at this point in the history
Fixes a bug where when you create a user through the dashboard, the default fallback of False would always be set for the `show_as_attending_event` field instead of using the user's privacy settings.
  • Loading branch information
henrikskog authored Apr 22, 2024
1 parent df2d2bd commit 4371019
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/events/dashboard/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from apps.authentication.models import OnlineUser as User
from apps.events.models import Attendee, Event
from apps.profiles.models import Privacy


def _get_attendee(attendee_id):
Expand Down Expand Up @@ -127,7 +128,14 @@ def handle_add_attendee(event: Event, user_id: int):
**resp,
}

attendee = Attendee(user=user, event=event.attendance_event)
privacy: Privacy = user.privacy
show_as_attending_event = bool(privacy.visible_as_attending_events)

attendee = Attendee(
user=user,
event=event.attendance_event,
show_as_attending_event=show_as_attending_event,
)
attendee.save()

resp = _get_event_context(event, resp)
Expand Down

0 comments on commit 4371019

Please sign in to comment.