Skip to content

Commit

Permalink
hotfix: new file doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
chanomkaimuk committed Aug 4, 2023
1 parent e4c065b commit f285d46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion commands/edit_entry/git_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def create_pull_request(
commit_msg=f"Modified translation for: lang={lang}, entry_id={entry_id}, field={field}",
new_contents=new_json_contents_str,
)
except UnknownObjectException:
except (UnknownObjectException, AttributeError):
# file doesn't exist, create and commit a new one
# ! Note that this immediately commits the new file!
json_file = WEBSITE_REPO.create_file(
Expand Down
6 changes: 3 additions & 3 deletions commands/edit_entry/github_pullrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ async def modify_json_and_create_pull_request(
# * take the english version and blank everything out
if not the_file:
the_json = await get_blank_json()

# * at this point, it's a valid json
the_json = json.loads(the_file.decoded_content.decode())
else:
# * at this point, it's a valid json
the_json = json.loads(the_file.decoded_content.decode())
# print("Modifying the json to reflect the changes...")
if field == "links":
proposed_text = process_list(proposed_text)
Expand Down

0 comments on commit f285d46

Please sign in to comment.