Skip to content

Commit

Permalink
Handle empty YAML files when syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
richardolsson committed Sep 27, 2023
1 parent efa525e commit f8865dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/translations/utils/sync_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def sync_project(project: Project):
if language_code in [lang.language_code for lang in project.languages.all()]:
try:
file_object = yaml.load(file.decoded_content, Loader=BaseLoader)
if file_object is None:
continue

flat_file_object = json_normalize(
file_object, sep=".", errors="ignore"
).to_dict(orient="records")[0]
Expand Down

0 comments on commit f8865dc

Please sign in to comment.