diff --git a/djangoldp/models.py b/djangoldp/models.py index f951763a1e5dbe45e7d738f2008d3895961149a8..22410de0930c040c36cf2c76a45e35e810c4b4e3 100644 --- a/djangoldp/models.py +++ b/djangoldp/models.py @@ -167,7 +167,7 @@ class LDPSource(Model): @receiver([post_save]) def auto_urlid(sender, instance, **kwargs): - if isinstance(instance, Model) and (instance.urlid is None or instance.urlid == ''): + if isinstance(instance, Model) and (instance.urlid is None or instance.urlid == '' or 'None' in instance.urlid): instance.urlid = instance.get_absolute_url() instance.save() diff --git a/djangoldp/permissions.py b/djangoldp/permissions.py index 250a969226cf9119c91484c9e212507d8c4178cd..b3c61c8ffbc1b9ac49d70e27c93a1bf22c53d27d 100644 --- a/djangoldp/permissions.py +++ b/djangoldp/permissions.py @@ -46,8 +46,9 @@ class LDPPermissions(BasePermission): else: if obj and hasattr(model._meta, 'owner_field') and ( - getattr(obj, getattr(model._meta, 'owner_field')) == user or getattr(obj, getattr(model._meta, - 'owner_field')) == user.id): + getattr(obj, getattr(model._meta, 'owner_field')) == user + or getattr(obj, getattr(model._meta, 'owner_field')) == user.urlid + or getattr(obj, getattr(model._meta, 'owner_field')) == user.id): return owner_perms else: