Browse Source

add a property to the ExampleState model

pull/1473/head
youichiro 3 years ago
parent
commit
47831f0782
1 changed files with 5 additions and 0 deletions
  1. 5
      backend/api/models.py

5
backend/api/models.py

@ -183,6 +183,11 @@ class ExampleState(models.Model):
class Meta:
unique_together = (('example', 'confirmed_by'),)
@property
def confirmed_user_role(self):
role_mapping = RoleMapping.objects.get(user=self.confirmed_by, project=self.example.project)
return role_mapping.role
class Comment(models.Model):
text = models.TextField()

Loading…
Cancel
Save