models: Fix bug in unique_together condition on RealmPlayground.

We don't need to worry about breaking already configured playgrounds
since this tweak makes the condition less strict.
This commit is contained in:
Sumanth V Rao
2021-05-13 07:09:29 +05:30
committed by Tim Abbott
parent 0b337e0819
commit 96c5a9e303
3 changed files with 21 additions and 2 deletions

View File

@@ -1038,7 +1038,7 @@ class RealmPlayground(models.Model):
)
class Meta:
unique_together = (("realm", "name"),)
unique_together = (("realm", "pygments_language", "name"),)
def __str__(self) -> str:
return f"<RealmPlayground({self.realm.string_id}): {self.pygments_language} {self.name}>"