Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/poly/handlers/sync_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ def _read_languages_from_projection(
if not language_data:
return {DefaultLanguage: {}, AdditionalLanguage: {}}

default_code = language_data.get("defaultLanguage")
default_code = language_data.get("defaultLanguageCode")
default_languages = {}
if default_code:
default_languages[default_code] = DefaultLanguage(
Expand Down
29 changes: 25 additions & 4 deletions src/poly/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2146,15 +2146,36 @@ def find_new_kept_deleted(
if not resource_info:
raise ValueError(f"Resource info not found for {file_path}")

resource_name = resource_info["resource_name"]
flow_name = flow_paths_to_names.get(
resource_utils.get_flow_name_from_path(file_path),
)

# Default Language will only be modified, but name must
# be read from file
if resource_type == DefaultLanguage:
resource = self.read_local_resource(
ResourceMapping(
resource_id=resource_info["resource_id"],
resource_type=resource_type,
resource_name=resource_name,
file_path=file_path,
flow_name=flow_name,
resource_prefix=resource_type.get_resource_prefix(
file_path=file_path
),
),
resource_mappings=[],
)
resource_name = resource.name

kept_resource_mappings.append(
ResourceMapping(
resource_id=resource_info["resource_id"],
resource_type=resource_type,
resource_name=resource_info["resource_name"],
resource_name=resource_name,
file_path=file_path,
flow_name=flow_paths_to_names.get(
resource_utils.get_flow_name_from_path(file_path),
),
flow_name=flow_name,
resource_prefix=resource_type.get_resource_prefix(file_path=file_path),
)
)
Expand Down
Loading