From a3668414fb32e86cec19d53e1c0feab08259d8de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ksenin=20Cakir?= Date: Fri, 3 May 2024 16:15:45 +0200 Subject: [PATCH] Fix indentation in _load_additional_permissions in deposit/permissions.py --- b2share/modules/deposit/permissions.py | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/b2share/modules/deposit/permissions.py b/b2share/modules/deposit/permissions.py index d7aa47d8ea..7d50aea479 100644 --- a/b2share/modules/deposit/permissions.py +++ b/b2share/modules/deposit/permissions.py @@ -315,23 +315,23 @@ def _load_additional_permissions(self): state_permission.explicit_needs.add(UserNeed(owner_id)) permissions.append(state_permission) - # Create permission for updating generic metadata fields. - # Only superadmin can modify published draft. - if self.deposit['publication_state'] != 'published': - new_state = new_deposit['publication_state'] - # Check if any metadata has been changed - del new_deposit['publication_state'] - original_metadata = deepcopy(self.deposit) - del original_metadata['publication_state'] - if original_metadata != new_deposit: - permissions.append( - UpdateDepositMetadataPermission(self.deposit, new_state) - ) - - if external_pids_changed: - permissions.append( - DepositFilesPermission(self.deposit, 'bucket-update') - ) + # Create permission for updating generic metadata fields. + # Only superadmin can modify published draft. + if self.deposit['publication_state'] != 'published': + new_state = new_deposit['publication_state'] + # Check if any metadata has been changed + del new_deposit['publication_state'] + original_metadata = deepcopy(self.deposit) + del original_metadata['publication_state'] + if original_metadata != new_deposit: + permissions.append( + UpdateDepositMetadataPermission(self.deposit, new_state) + ) + + if external_pids_changed: + permissions.append( + DepositFilesPermission(self.deposit, 'bucket-update') + ) if len(permissions) > 1: self.permissions.add(AndPermissions(*permissions))