Refactor code + fix a small bug
This commit is contained in:
parent
d0dbb3a887
commit
e1f19fb794
3 changed files with 14 additions and 12 deletions
|
@ -57,7 +57,10 @@ class Ignore(models.Model):
|
|||
|
||||
@classmethod
|
||||
def get_ignored_users(self, user):
|
||||
return self.objects.get(user=user).ignored_users.all()
|
||||
try:
|
||||
return self.objects.get(user=user).ignored_users.all()
|
||||
except Ignore.DoesNotExist:
|
||||
return Profile.objects.none()
|
||||
|
||||
@classmethod
|
||||
def add_ignore(self, current_user, friend):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue