diff --git a/onadata/apps/api/tasks.py b/onadata/apps/api/tasks.py index 1138fa4a44..5eb20647dc 100644 --- a/onadata/apps/api/tasks.py +++ b/onadata/apps/api/tasks.py @@ -21,7 +21,6 @@ from onadata.apps.api.models.organization_profile import OrganizationProfile from onadata.apps.logger.models import Instance, ProjectInvitation, XForm, Project from onadata.celeryapp import app -from onadata.libs.permissions import ROLES_ORDERED from onadata.libs.utils.cache_tools import invalidate_organization_cache from onadata.libs.utils.email import send_generic_email from onadata.libs.utils.model_tools import queryset_iterator diff --git a/onadata/apps/api/viewsets/organization_profile_viewset.py b/onadata/apps/api/viewsets/organization_profile_viewset.py index 0c89d2ca4b..9f035b9d0a 100644 --- a/onadata/apps/api/viewsets/organization_profile_viewset.py +++ b/onadata/apps/api/viewsets/organization_profile_viewset.py @@ -130,7 +130,7 @@ def members(self, request, *args, **kwargs): serializer.save() - data = OrganizationSerializer( + data = self.serializer_class( organization, context={"request": request} ).data # pylint: disable=attribute-defined-outside-init diff --git a/onadata/libs/utils/cache_tools.py b/onadata/libs/utils/cache_tools.py index 4dfc7346aa..e480517e7e 100644 --- a/onadata/libs/utils/cache_tools.py +++ b/onadata/libs/utils/cache_tools.py @@ -7,6 +7,8 @@ from django.core.cache import cache from django.utils.encoding import force_bytes +from onadata.libs.permissions import ROLES_ORDERED + # Cache names used in project serializer PROJ_PERM_CACHE = "ps-project_permissions-" PROJ_NUM_DATASET_CACHE = "ps-num_datasets-"