Skip to content

Commit 227ded3

Browse files
committed
ugly fix to make has-unreads view work
1 parent 96a6dde commit 227ded3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

users/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from django.contrib.auth.models import AbstractUser
22
from django.db import models
3-
from chats.models import ProjectChat
3+
from django.db.models import QuerySet
44

55
from users.constants import (
66
ADMIN,
@@ -134,7 +134,9 @@ def calculate_ordering_score(self) -> int:
134134
score += 7
135135
return score
136136

137-
def get_project_chats(self) -> list:
137+
def get_project_chats(self) -> QuerySet:
138+
from chats.models import ProjectChat
139+
138140
user_project_ids = self.collaborations.all().values_list("project_id", flat=True)
139141
return ProjectChat.objects.filter(project__in=user_project_ids)
140142

0 commit comments

Comments
 (0)