Skip to content

Commit 1574621

Browse files
committed
perf: only render manage links for organisers
This means we won't need to make the sql requests to figure out if the user is organiser or the event
1 parent c50cf25 commit 1574621

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/views/events/_event.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- if @user.attending?(event.__getobj__)
1010
%span.badge.bg-success.mb-3.mb-md-0
1111
= link_to 'Attending', event.path, class: 'text-light text-decoration-none'
12-
- if @user.event_organiser?(event)
12+
- if @user.organiser? && @user.event_organiser?(event)
1313
%span.badge.bg-secondary.mb-3.mb-md-0
1414
= link_to 'Manage', event.admin_path, class: 'text-light text-decoration-none'
1515
.order-md-1

0 commit comments

Comments
 (0)