Skip to content

Commit 4371019

Browse files
authored
Fix users not showing up in attendee lists (#3171)
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.
1 parent df2d2bd commit 4371019

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

apps/events/dashboard/utils.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from apps.authentication.models import OnlineUser as User
55
from apps.events.models import Attendee, Event
6+
from apps.profiles.models import Privacy
67

78

89
def _get_attendee(attendee_id):
@@ -127,7 +128,14 @@ def handle_add_attendee(event: Event, user_id: int):
127128
**resp,
128129
}
129130

130-
attendee = Attendee(user=user, event=event.attendance_event)
131+
privacy: Privacy = user.privacy
132+
show_as_attending_event = bool(privacy.visible_as_attending_events)
133+
134+
attendee = Attendee(
135+
user=user,
136+
event=event.attendance_event,
137+
show_as_attending_event=show_as_attending_event,
138+
)
131139
attendee.save()
132140

133141
resp = _get_event_context(event, resp)

0 commit comments

Comments
 (0)