Skip to content

Commit

Permalink
Fix link edit/delete buttons showing when not logged in (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-kelp committed Feb 5, 2024
1 parent f77847b commit ddcdca9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h3>Links</h3>
{% for link in list %}
<li class="list-group-item">
<a href="{{ link.url }}" rel="noopener noreferrer" target="_blank">{{ link.title or link.url }}</a>
{% if officer and (is_admin_or_coordinator or link.creator_id == current_user.id) %}
{% if officer and (is_admin_or_coordinator or link.created_by == current_user.id) %}
<a href="{{ url_for('main.link_api_edit', officer_id=officer.id, obj_id=link.id) }}">
<span class="sr-only">Edit</span>
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
Expand Down Expand Up @@ -45,7 +45,7 @@ <h3>Videos</h3>
{% if link.title %}<h5>{{ link.title }}</h5>{% endif %}
{% if officer and (current_user.is_administrator
or (current_user.is_area_coordinator and current_user.ac_department_id == officer.department_id)
or link.creator_id == current_user.id) %}
or link.created_by == current_user.id) %}
<a href="{{ url_for('main.link_api_edit', officer_id=officer.id, obj_id=link.id) }}">
<span class="sr-only">Edit</span>
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
Expand Down Expand Up @@ -85,7 +85,7 @@ <h3>Other videos</h3>
<a href="{{ link.url }}" target="_blank" rel="noopener noreferrer">{{ link.title or link.url }}</a>
{% if officer and (current_user.is_administrator
or (current_user.is_area_coordinator and current_user.ac_department_id == officer.department_id)
or link.creator_id == current_user.id) %}
or link.created_by == current_user.id) %}
<a href="{{ url_for('main.link_api_edit', officer_id=officer.id, obj_id=link.id) }}">
<span class="sr-only">Edit</span>
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
Expand Down

0 comments on commit ddcdca9

Please sign in to comment.