Skip to content

Commit

Permalink
Fix unique constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Salin committed Apr 29, 2015
1 parent 00bdf71 commit 173997b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rollyourown/seo/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def __new__(mcs, name, bases, attrs):
return new_class

def get_unique_together(self, options):
if not options.use_sites and not options.use_i18n:
return tuple()
ut = []
for ut_set in self.unique_together:
ut_set = [a for a in ut_set]
Expand Down Expand Up @@ -283,7 +285,7 @@ def _process_context(self, context):

def _populate_from_kwargs(self):
return {'view_name': self._view}

def _resolve_value(self, name):
value = super(ViewMetadataBase, self)._resolve_value(name)
try:
Expand All @@ -293,7 +295,7 @@ def _resolve_value(self, name):

def __unicode__(self):
return self._view

class Meta:
abstract = True
unique_together = self.get_unique_together(options)
Expand Down

0 comments on commit 173997b

Please sign in to comment.