| 158 | shutil.move(path, unique_archive_file_path) |
| 159 | |
| 160 | def load_script_code(self, script_name, user): |
| 161 | if not self._authorizer.can_edit_code(user.user_id): |
| 162 | logging.warning('User ' + str(user) + ' is not allowed to edit code') |
| 163 | raise InvalidAccessException('Code edit is not allowed for this user') |
| 164 | |
| 165 | config_wrapper = self.load_config(script_name, user) |
| 166 | if config_wrapper is None: |
| 167 | return None |
| 168 | |
| 169 | config = config_wrapper.get('config') |
| 170 | return self._load_script_code_by_config(config) |
| 171 | |
| 172 | def _load_script_code_by_config(self, plain_config): |
| 173 | script_path = plain_config.get(SCRIPT_PATH_FIELD) |