diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-01-29 19:09:33 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-01-29 19:09:33 +0100 |
commit | 1d1d49c4c8e01650d09f174fee923243361f20f7 (patch) | |
tree | 9530ea899863d698dbda66488714670307e7aa07 /chimere | |
parent | 717ee6e71d780d11c0d4bcaf445f966c0cfd0098 (diff) | |
download | Chimère-1d1d49c4c8e01650d09f174fee923243361f20f7.tar.bz2 Chimère-1d1d49c4c8e01650d09f174fee923243361f20f7.zip |
Update migration errors
Diffstat (limited to 'chimere')
-rw-r--r-- | chimere/models.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/chimere/models.py b/chimere/models.py index 5a4be28..6b0d4b3 100644 --- a/chimere/models.py +++ b/chimere/models.py @@ -1255,11 +1255,14 @@ def area_post_save(sender, **kwargs): perm = Permission.objects.filter(codename=mnemo) lbl = "Can change " + area.name if not perm.count(): - content_type = ContentType.objects.get(app_label="chimere", + try: + content_type = ContentType.objects.get(app_label="chimere", model="area") - perm = Permission(name=lbl, content_type_id=content_type.id, - codename=mnemo) - perm.save() + perm = Permission(name=lbl, content_type_id=content_type.id, + codename=mnemo) + perm.save() + except ObjectDoesNotExist: + pass else: perm = perm.all()[0] if old_name != area.name: |