Replace 'id' with 'pk'. Fixes #570

- Legacy-Id: 2750
This commit is contained in:
Emilio A. Sánchez López 2011-01-21 08:32:31 +00:00
parent 92e9360cea
commit 6c2621ca18

View file

@ -125,7 +125,7 @@ class Workflow(models.Model):
ctype = ContentType.objects.get_for_model(obj)
try:
wor = WorkflowObjectRelation.objects.get(content_type=ctype, content_id=obj.id)
wor = WorkflowObjectRelation.objects.get(content_type=ctype, content_id=obj.pk)
except WorkflowObjectRelation.DoesNotExist:
WorkflowObjectRelation.objects.create(content = obj, workflow=self)
workflows.utils.set_state(obj, self.initial_state)
@ -354,4 +354,4 @@ class StatePermissionRelation(models.Model):
role = models.ForeignKey(Role, verbose_name=_(u"Role"))
def __unicode__(self):
return "%s %s %s" % (self.state.name, self.role.name, self.permission.name)
return "%s %s %s" % (self.state.name, self.role.name, self.permission.name)