diff --git a/src/django_perms_provisioner/management/commands/loadperms.py b/src/django_perms_provisioner/management/commands/loadperms.py index 70315f3..09dd253 100644 --- a/src/django_perms_provisioner/management/commands/loadperms.py +++ b/src/django_perms_provisioner/management/commands/loadperms.py @@ -152,7 +152,7 @@ def get_permissions_for_app(self, app_label: str, permissions: list) -> list: """ permission_list = [] for permission in permissions: - model_name, codename = permission.split(".") + model_name, codename = permission.split(".", 1) try: permission_obj = Permission.objects.get_by_natural_key( codename, app_label, model_name diff --git a/src/django_perms_provisioner/management/schemas.py b/src/django_perms_provisioner/management/schemas.py index 49be30f..fa726d4 100644 --- a/src/django_perms_provisioner/management/schemas.py +++ b/src/django_perms_provisioner/management/schemas.py @@ -15,7 +15,7 @@ "schema": { "required": True, "type": "string", - "regex": "^[\w\_]+\.[\w\_]+$", + "regex": "^[\w\_]+\.[\w\_\.]+$", }, }, },