We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db42cbf commit 4a38e06Copy full SHA for 4a38e06
1 file changed
src/apps/profiles/views.py
@@ -70,10 +70,14 @@ def get_context_data(self, **kwargs):
70
context = super().get_context_data(**kwargs)
71
user = self.get_object()
72
user_data = UserSerializer(user).data
73
- # Fetch competitions organized by this user
+ # Fetch competitions organized by this user (as owner or collaborator)
74
organized_qs = (
75
Competition.objects
76
- .filter(created_by=user, published=True)
+ .filter(
77
+ Q(created_by=user) | Q(collaborators=user),
78
+ published=True,
79
+ )
80
+ .distinct()
81
.order_by("-created_when")
82
)
83
# Serialize into the same shape your public-list cards expect
0 commit comments