from django import template

from .. import models

register = template.Library()


@register.assignment_tag()
def is_following(user, project):
    return models.Follow.objects.filter(
        enabled=True,
        project=project,
        creator=user
    ).exists()

euth/follows/templatetags/follow_tags.py
from django import template

from .. import models

register = template.Library()


@register.assignment_tag()
def is_following(user, project):
    if not user.is_anonymous():
        return models.Follow.objects.filter(
            enabled=True,
            project=project,
            creator=user
        ).exists()
    else:
        return False

euth/follows/templatetags/follow_tags.py
diff --git a/euth/follows/templatetags/follow_tags.py b/euth/follows/templatetags/follow_tags.py
index a43b2cfc8..2f794a306 100644
--- a/euth/follows/templatetags/follow_tags.py
+++ b/euth/follows/templatetags/follow_tags.py
@@ -7,8 +7,11 @@
 
 @register.assignment_tag()
 def is_following(user, project):
-    return models.Follow.objects.filter(
-        enabled=True,
-        project=project,
-        creator=user
-    ).exists()
+    if not user.is_anonymous():
+        return models.Follow.objects.filter(
+            enabled=True,
+            project=project,
+            creator=user
+        ).exists()
+    else:
+        return False
diff --git a/euth/projects/templates/euth_projects/includes/project_hero_unit.html b/euth/projects/templates/euth_projects/includes/project_hero_unit.html
index 3ce971351..265abc6ee 100644
--- a/euth/projects/templates/euth_projects/includes/project_hero_unit.html
+++ b/euth/projects/templates/euth_projects/includes/project_hero_unit.html
@@ -28,14 +28,14 @@ <h1 class="herounit-title">{{ project.name }}</h1>
                 </p>
                 <p class="herounit-description">{{ project.description | truncatechars:200 }}</p>
 
-                {% has_perm 'euth_projects.edit_project' user project as can_edit_project %}
+                {% has_perm 'a4projects.edit_project' user project as can_edit_project %}
                 {% if can_edit_project %}
                     <a href="{% url 'dashboard-project-edit' project.organisation.slug project.slug %}" class="btn btn-dark btn-primary btn-sm">
                         <i class="fa fa-edit"></i> {% trans 'edit' %}
                     </a>
                 {% endif %}
 
-                {% has_perm 'euth_projects.view_project' request.user project as can_view_project %}
+                {% has_perm 'a4projects.view_project' request.user project as can_view_project %}
                 {% block phase_cta %}{% endblock %}
                 {% if can_view_project %}
                     {% react_follows project %}

when I log out while  I am on my profile page I get a 500

