Skip to content

Commit

Permalink
IEBH-31: Fixed ability to upload to core zone and download from green…
Browse files Browse the repository at this point in the history
…room zone
  • Loading branch information
mloshakov committed Nov 21, 2024
1 parent 677bca5 commit eb9356c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions app/commands/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,8 @@ def file_put(**kwargs): # noqa: C901
user = UserConfig()
zone = get_zone(zone) if zone else AppConfig.Env.green_zone.lower()

toc = customized_error_msg(ECustomizedError.TOU_CONTENT).replace(' ', '...')
if zone.lower() == AppConfig.Env.core_zone.lower() and click.confirm(fit_terminal_width(toc), abort=True):
pass
if zone.lower() == AppConfig.Env.core_zone.lower():
SrvErrorHandler.customized_handle(ECustomizedError.INVALID_ZONE, True)

if len(paths) == 0:
SrvErrorHandler.customized_handle(ECustomizedError.INVALID_PATHS, True)
Expand Down Expand Up @@ -344,7 +343,7 @@ def file_list(paths, zone, page, page_size, detached):
@click.option(
'-z',
'--zone',
default=AppConfig.Env.green_zone,
default=AppConfig.Env.core_zone,
required=False,
help=file_help.file_help_page(file_help.FileHELP.FILE_SYNC_Z),
show_default=False,
Expand Down Expand Up @@ -377,6 +376,8 @@ def file_download(**kwargs):
zone = get_zone(zone) if zone else AppConfig.Env.green_zone
interactive = False if len(paths) > 1 else True

if zone.lower() == AppConfig.Env.green_zone.lower():
SrvErrorHandler.customized_handle(ECustomizedError.INVALID_ZONE, True)
if len(paths) == 0:
SrvErrorHandler.customized_handle(ECustomizedError.MISSING_PROJECT_CODE, interactive)
if geid:
Expand Down
2 changes: 1 addition & 1 deletion app/resources/custom_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Error:
'Please verify your role and check that the file exists.'
),
'FOLDER_NOT_FOUND': 'Folder not found in the Project.',
'INVALID_ZONE': 'The data zone invalid. Please verify the data location and try again.',
'INVALID_ZONE': 'The data zone is invalid. Please verify the data location and try again.',
'FOLDER_EMPTY': 'Folder is empty.',
'RESERVED_FOLDER': 'Reserved folder name, please rename the folder and try again later',
'INVALID_ACTION': 'Invalid action: %s',
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "app"
version = "2.2.6"
version = "2.2.7"
description = "This service is designed to support pilot platform"
authors = ["Indoc Research"]

Expand Down

0 comments on commit eb9356c

Please sign in to comment.