diff --git a/project/circles/views.py b/project/circles/views.py index f44637b..9d6b83c 100644 --- a/project/circles/views.py +++ b/project/circles/views.py @@ -170,6 +170,9 @@ def get_form(self, form_class=None): def join_as_companion(request, circle_id): if request.user.is_authenticated: + # Ensure user is not already a companion of any circle + if Companion.objects.filter(user=request.user).exists(): + return render(request, "404.html") # Ensure circle exists try: circle = Circle.objects.get(pk=circle_id)