Send updated user folder permissions to the API

Integrates the folder permissions form with the updated API endpoint
to store changes in the user folders.

Since user folder permissions are returned in the full list of template
folders for the service we need to invalidate the cache key for it each
time we update user permissions.
This commit is contained in:
Alexey Bezhan
2019-02-27 15:45:18 +00:00
parent 3ba4a22b7c
commit 6fa975e867
5 changed files with 58 additions and 5 deletions

View File

@@ -420,7 +420,7 @@ PermissionsAbstract = type("PermissionsAbstract", (StripWhitespaceForm,), {
class PermissionsForm(PermissionsAbstract):
def __init__(self, all_template_folders=None, *args, **kwargs):
super().__init__(*args, **kwargs)
if all_template_folders:
if all_template_folders is not None:
self.folder_permissions.all_template_folders = all_template_folders
self.folder_permissions.choices = [
(item['id'], item['name']) for item in ([{'name': 'Templates', 'id': None}] + all_template_folders)