Skip to content

Commit 0666f7b

Browse files
authored
fix(OpenRosa): assign default openrosa model-level permissions to the correct database (#5413)
Fixes a 500 error when attempting to create an account on certain servers, e.g. the Global KoboToolbox instance (kf.kobotoolbox.org). This is a critical fix, so please excuse the terseness of this description.
1 parent 3b59a4a commit 0666f7b

File tree

1 file changed

+2
-1
lines changed
  • kpi/deployment_backends/kc_access

1 file changed

+2
-1
lines changed

kpi/deployment_backends/kc_access/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def grant_kc_model_level_perms(user: 'kobo_auth.User'):
130130
'Searched for content types {}.'.format(content_types)
131131
)
132132

133-
user.user_permissions.add(*permissions_to_assign)
133+
with use_db(settings.OPENROSA_DB_ALIAS):
134+
user.user_permissions.add(*permissions_to_assign)
134135

135136

136137
def set_kc_anonymous_permissions_xform_flags(

0 commit comments

Comments
 (0)