Commits

Anonymous committed a27f916

per-object-permissions: Small change to django.db.models.base check to make it more explicit

Comments (0)

Files changed (1)

django/db/models/base.py

                 except FieldDoesNotExist:
                     field.contribute_to_class(new_class, field.name)
 
-        if getattr(new_class._meta, 'row_level_permissions', None):
+        if getattr(new_class._meta, 'row_level_permissions', False):
             from django.contrib.auth.models import RowLevelPermission
             gen_rel = django.db.models.GenericRelation(RowLevelPermission, object_id_field="model_id", content_type_field="model_ct")
             new_class.add_to_class("row_level_permissions", gen_rel)