Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(1.14/api/web): fix resource diff #1083

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,12 @@ def get(self, request, *args, **kwargs):
source_resource_version_id = data.get("source_resource_version_id")
target_resource_version_id = data.get("target_resource_version_id")

# 如果 source_resource_version_id 为空,需要将 source_resource_data 置为空,相当于
# target_resource_data 和 空版本对比
source_resource_data = (
ResourceVersionHandler.get_data_by_id_or_new(request.gateway, source_resource_version_id)
if source_resource_version_id
else []
)
source_resource_data = []
# 如果 source_resource_version_id 和 target_resource_version_id 都不为空,则 source_resource_data数据不为空
if source_resource_version_id or target_resource_version_id:
source_resource_data = ResourceVersionHandler.get_data_by_id_or_new(
request.gateway, source_resource_version_id
)

target_resource_data = ResourceVersionHandler.get_data_by_id_or_new(
request.gateway, target_resource_version_id
Expand Down
Loading