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 #19110: Implement job to copy mis-placed translation images #21378

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
Clean up validation logic
  • Loading branch information
U8NWXD committed Dec 10, 2024
commit 7d4ef07a21898274d7066e1c3d7fd2561e6c3ffd
15 changes: 3 additions & 12 deletions core/jobs/batch_jobs/missing_translation_images_repair_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,11 @@ def _filter_copy_ops(
Returns:
bool. True if and only if the source file exists and the destination
file does not exist.

Raises:
Exception. Raised if the dictionary is malformed, specifically if
the values of either src_exist or dst_exist do not have length
1.
"""
_, copy_info = group
if (
len(copy_info['src_exist']) != 1
or len(copy_info['dst_exist']) != 1
):
raise Exception(
'Unexpected copy info dict structure: %s' % copy_info)
return copy_info['src_exist'][0] and not copy_info['dst_exist'][0]
src_exist, = copy_info['src_exist']
dst_exist, = copy_info['dst_exist']
return src_exist and not dst_exist


class CopyMissingTranslationImagesJob(base_jobs.JobBase):
Expand Down
Loading