Skip to content

Commit

Permalink
[dy] Update
Browse files Browse the repository at this point in the history
  • Loading branch information
dy46 committed May 6, 2024
1 parent 5bffaee commit d60cf47
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions mage_ai/api/policies/BasePolicy.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
active_project_settings,
project_platform_activated,
)
from mage_ai.settings.utils import base_repo_path
from mage_ai.shared.hash import extract, ignore_keys

CONTEXT_DATA_KEY_USER_ROLE_VALIDATIONS = '__user_role_validations'
Expand Down Expand Up @@ -77,7 +76,7 @@ def __init__(self, resource, current_user, **kwargs):

def initialize_project_uuid(self):
if project_platform_activated():
active_project = active_project_settings(repo_path=base_repo_path()) or {}
active_project = active_project_settings(user=self.current_user) or {}
project_name = active_project.get('uuid')
if project_name:
self.project_uuid = get_project_uuid(
Expand Down
3 changes: 1 addition & 2 deletions mage_ai/api/policies/FilePolicy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from mage_ai.api.policies.BasePolicy import BasePolicy
from mage_ai.api.presenters.FilePresenter import FilePresenter
from mage_ai.data_preparation.repo_manager import get_repo_config
from mage_ai.settings.repo import get_repo_path


class FilePolicy(BasePolicy):
Expand All @@ -13,7 +12,7 @@ def initialize_project_uuid(self):
repo_config = get_repo_config(file.repo_path)
self.project_uuid = repo_config.project_uuid
else:
self.project_uuid = get_repo_path(root_project=True)
super().initialize_project_uuid()


FilePolicy.allow_actions([
Expand Down
1 change: 0 additions & 1 deletion mage_ai/settings/platform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ def active_project_settings(
def project_platform_settings(
repo_path: str = None,
mage_projects_only: bool = False,
user=None,
) -> Dict:
mapping = (__combined_platform_settings(
repo_path=repo_path,
Expand Down
3 changes: 1 addition & 2 deletions mage_ai/settings/platform/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ def get_pipeline_from_platform(

return Pipeline.get(
pipeline_uuid,
check_if_exists=check_if_exists,
repo_path=repo_path,
all_projects=False if repo_path else True,
check_if_exists=check_if_exists,
repo_path=repo_path,
use_repo_path=use_repo_path,
)
Expand Down

0 comments on commit d60cf47

Please sign in to comment.