Revert unique user/primary pair

This commit is contained in:
Grant McConnaughey 2015-10-23 09:33:10 -05:00
parent b14fe1624a
commit a258377207
5 changed files with 25 additions and 41 deletions

25
.coveragerc Normal file
View file

@ -0,0 +1,25 @@
[report]
exclude_lines =
pragma: no cover
# Don't complain about missing debug-only code:
def __repr__
if self\.debug
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
except ImportError
# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
omit =
avatar/*/migrations/*
show_missing = True
precision = 2
[html]
directory = output/html/

View file

@ -4,7 +4,6 @@ Changelog
* 2.2 (Not released)
* Added Python 3.5 support
* Added Django 1.9 support
* Added database-level enforcement of unique user/primary pair in Avatar model.
* Removed Python 2.6 support
* Removed Django 1.4, 1.5, and 1.6 support

View file

@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('avatar', '0001_initial'),
]
operations = [
migrations.AlterUniqueTogether(
name='avatar',
unique_together=set([('user', 'primary')]),
),
]

View file

@ -1,21 +0,0 @@
"""
Django migrations for django-avatar app
This package does not contain South migrations. South migrations can be found
in the ``south_migrations`` package.
"""
SOUTH_ERROR_MESSAGE = """\n
For South support, customize the SOUTH_MIGRATION_MODULES setting like so:
SOUTH_MIGRATION_MODULES = {
'django-avatar': 'avatar.south_migrations',
}
"""
# Ensure the user is not using Django 1.6 or below with South
try:
from django.db import migrations # noqa
except ImportError:
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured(SOUTH_ERROR_MESSAGE)

View file

@ -72,7 +72,6 @@ class Avatar(models.Model):
class Meta:
app_label = 'avatar'
unique_together = ('user', 'primary')
def __unicode__(self):
return _(six.u('Avatar for %s')) % self.user