Skip to content

Commit

Permalink
Now root prefix is retrieved properly from project configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoveda committed Aug 24, 2020
1 parent 425315b commit a065624
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions artellapipe/managers/files.py
Expand Up @@ -209,7 +209,8 @@ def fix_path(self, path_to_fix, clean_path=True):
if not project_var:
return path_to_fix

root_prefix = artella_lib.config.get('app', 'root_prefix')
project_type = artellapipe.project.get_project_type()
root_prefix = artellapipe.libs.artella.config.get('app', project_type).get('root_prefix', 'ART_LOCAL_ROOT')

if path_to_fix.startswith('${}/'.format(project_env_var)):
path_to_fix = path_to_fix.replace('${}/'.format(project_env_var), project_var)
Expand Down Expand Up @@ -300,7 +301,8 @@ def prefix_path_with_artella_env_path(self, path_to_prefix):
:return: str
"""

root_prefix = artella_lib.config.get('app', 'root_prefix')
project_type = artellapipe.project.get_project_type()
root_prefix = artellapipe.libs.artella.config.get('app', project_type).get('root_prefix', 'ART_LOCAL_ROOT')
artella_var = os.environ.get(root_prefix, None)
if not artella_var:
return path_to_prefix
Expand Down Expand Up @@ -400,7 +402,7 @@ def unlock_file(self, file_path=None, notify=False, warn_user=True):
LOGGER.warning('File Path "{}" is not valid!'.format(valid_path))
return False

if warn_user:
if warn_user and artellapipe.project.is_indie():
msg = 'If changes in file: \n\n{}\n\n are not submitted to Artella yet, submit them before ' \
'unlocking the file please. \n\n Do you want to continue?'.format(file_path)
res = tp.Dcc.confirm_dialog(
Expand Down

0 comments on commit a065624

Please sign in to comment.