prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  when I log out while  I am on my profile page I get a 500
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `euth/follows/templatetags/follow_tags.py`
  Content:
  ```
  1 from django import template
  2 
  3 from .. import models
  4 
  5 register = template.Library()
  6 
  7 
  8 @register.assignment_tag()
  9 def is_following(user, project):
  10     return models.Follow.objects.filter(
  11         enabled=True,
  12         project=project,
  13         creator=user
  14     ).exists()
  15
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/euth/follows/templatetags/follow_tags.py b/euth/follows/templatetags/follow_tags.py
  --- 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
  
verification_info: {"golden_diff": "diff --git a/euth/follows/templatetags/follow_tags.py b/euth/follows/templatetags/follow_tags.py\n--- a/euth/follows/templatetags/follow_tags.py\n+++ b/euth/follows/templatetags/follow_tags.py\n@@ -7,8 +7,11 @@\n \n @register.assignment_tag()\n def is_following(user, project):\n-    return models.Follow.objects.filter(\n-        enabled=True,\n-        project=project,\n-        creator=user\n-    ).exists()\n+    if not user.is_anonymous():\n+        return models.Follow.objects.filter(\n+            enabled=True,\n+            project=project,\n+            creator=user\n+        ).exists()\n+    else:\n+        return False\n", "issue": "when I log out while  I am on my profile page I get a 500\n\n", "before_files": [{"content": "from django import template\n\nfrom .. import models\n\nregister = template.Library()\n\n\n@register.assignment_tag()\ndef is_following(user, project):\n    return models.Follow.objects.filter(\n        enabled=True,\n        project=project,\n        creator=user\n    ).exists()\n", "path": "euth/follows/templatetags/follow_tags.py"}], "after_files": [{"content": "from django import template\n\nfrom .. import models\n\nregister = template.Library()\n\n\n@register.assignment_tag()\ndef is_following(user, project):\n    if not user.is_anonymous():\n        return models.Follow.objects.filter(\n            enabled=True,\n            project=project,\n            creator=user\n        ).exists()\n    else:\n        return False\n", "path": "euth/follows/templatetags/follow_tags.py"}]}