Skip to content
Snippets Groups Projects

Resolve "`aleksis-admin yarn install` needs a database"

@@ -113,11 +113,10 @@ def has_person_group_object_perm(perm: str):
"""
name = f"has_person_group_object_perm:{perm}"
ct = get_content_type_by_perm(perm)
permissions = Permission.objects.filter(content_type=ct, codename=perm)
@predicate(name)
def fn(user: User, obj: Person) -> bool:
ct = get_content_type_by_perm(perm)
permissions = Permission.objects.filter(content_type=ct, codename=perm)
groups = obj.member_of.all()
qs = UserObjectPermission.objects.filter(
object_pk__in=list(groups.values_list("pk", flat=True)),
@@ -151,7 +150,6 @@ def has_lesson_group_object_perm(perm: str):
"""
name = f"has_lesson_group_object_perm:{perm}"
@predicate(name)
def fn(user: User, obj: LessonPeriod) -> bool:
if hasattr(obj, "lesson"):
@@ -177,7 +175,6 @@ def has_personal_note_group_perm(perm: str):
"""
name = f"has_personal_note_person_or_group_perm:{perm}"
@predicate(name)
def fn(user: User, obj: PersonalNote) -> bool:
if hasattr(obj, "person"):
Loading