mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
added database-level enforcement of unique user+primary pair in Avatar model
This commit is contained in:
parent
a91b9eccb9
commit
1c56ed5dbc
1 changed files with 1 additions and 0 deletions
|
|
@ -72,6 +72,7 @@ class Avatar(models.Model):
|
|||
|
||||
class Meta:
|
||||
app_label = 'avatar'
|
||||
unique_together = ('user', 'primary')
|
||||
|
||||
def __unicode__(self):
|
||||
return _(six.u('Avatar for %s')) % self.user
|
||||
|
|
|
|||
Loading…
Reference in a new issue