mirror of
https://github.com/ae-utbm/sith.git
synced 2026-06-05 07:39:21 +00:00
add translations
This commit is contained in:
@@ -130,6 +130,16 @@ class Role(OrderedModel):
|
||||
|
||||
order_with_respect_to = "election"
|
||||
|
||||
class Meta(OrderedModel.Meta):
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=["title", "election"],
|
||||
name="title_election_unique_constraint",
|
||||
violation_error_message=_("This role already exists for this election"),
|
||||
violation_error_code="invalid",
|
||||
)
|
||||
]
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.title} - {self.election.title}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user