diff --git a/onadata/libs/utils/project_utils.py b/onadata/libs/utils/project_utils.py index 9e1dbc128d..c282133bb4 100644 --- a/onadata/libs/utils/project_utils.py +++ b/onadata/libs/utils/project_utils.py @@ -21,9 +21,13 @@ from onadata.apps.logger.models.project import Project from onadata.apps.logger.models.xform import XForm from onadata.celeryapp import app -from onadata.libs.permissions import (ROLES, OwnerRole, - get_object_users_with_permissions, - get_role, is_organization) +from onadata.libs.permissions import ( + ROLES, + OwnerRole, + get_object_users_with_permissions, + get_role, + is_organization, +) from onadata.libs.utils.common_tags import API_TOKEN, OWNER_TEAM_NAME from onadata.libs.utils.common_tools import report_exception @@ -32,7 +36,6 @@ class ExternalServiceRequestError(Exception): """ Custom Exception class for External service requests i.e Formbuilder """ - pass def get_project_users(project): @@ -202,8 +205,14 @@ def assign_change_asset_permission( ) return resp + @app.task(bind=True, max_retries=3) -def propagate_project_permissions_async(self, project_id: int, headers: Optional[dict] = None, use_asset_owner_auth: bool = True): +def propagate_project_permissions_async( + self, + project_id: int, + headers: Optional[dict] = None, + use_asset_owner_auth: bool = True, +): """ Asynchronously propagates Project Permissions to the Formbuilder assets within the project """