Skip to content

Commit

Permalink
fix(deserialize OAPs): read only valid files (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Oct 16, 2023
1 parent f500134 commit 0f73912
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dsp_permissions_scripts/oap/oap_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def deserialize_resource_oaps(
"""Deserialize the resource OAPs from JSON files."""
folder = _get_project_data_path(shortcode, mode)
resource_oaps = []
for file in folder.iterdir():
for file in [f for f in folder.iterdir() if f.suffix == ".json"]:
with open(file, mode="r", encoding="utf-8") as f:
resource_oaps.append(Oap.model_validate_json(f.read()))
return resource_oaps

0 comments on commit 0f73912

Please sign in to comment.