Fix race in chat ignore

This commit is contained in:
cuom1999 2022-04-29 15:27:25 -05:00
parent 1dfc6d312d
commit e51129d36f
2 changed files with 3 additions and 2 deletions

View file

@ -58,8 +58,8 @@ class Ignore(models.Model):
@classmethod
def get_ignored_users(self, user):
try:
return self.objects.get(user=user).ignored_users.all()
except Ignore.DoesNotExist:
return self.objects.filter(user=user)[0].ignored_users.all()
except:
return Profile.objects.none()
@classmethod

View file

@ -406,6 +406,7 @@ class Problem(models.Model):
('change_public_visibility', 'Change is_public field'),
('change_manually_managed', 'Change is_manually_managed field'),
('see_organization_problem', 'See organization-private problems'),
('suggest_problem_changes', 'Suggest changes to problem'),
)
verbose_name = _('problem')
verbose_name_plural = _('problems')