FEATURE: Show login button on error page if user is not logged in

FEATURE: Show login button on error page if user is not logged in

diff --git a/app/views/exceptions/not_found.html.erb b/app/views/exceptions/not_found.html.erb
index 873a79c..6975dbf 100644
--- a/app/views/exceptions/not_found.html.erb
+++ b/app/views/exceptions/not_found.html.erb
@@ -1,7 +1,7 @@
 <div class="page-not-found">
   <h1 class="title"><%= @title %></h1>
 
-  <%- if (@group&.allow_membership_requests || @group&.public_admission) && !current_user %>
+  <%- if !current_user %>
     <a href="<%= path "/login" %>" class='btn btn-primary'><%= SvgSprite.raw_svg('fa-user') %><%= I18n.t('log_in') %></a>
   <%- end %>
 

GitHub sha: bd3c0dd5

Why was this change made?

Sometimes, if the detailed 404 pages are turned on, we show Request membership or Join group buttons. One case when we don’t is when the user must be a staff member to see the topic (as there is nothing they can do to become staff).

There is a chance that the user is actually a staff member, but they are not logged in. I added this button for this specific reason.

1 Like

Thanks for the detailed context :+1:

Next time, it would be even better to put it directly in the commit message :wink: