Skip to content

Commit

Permalink
chore: Run ruff check .
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 14, 2024
1 parent 9b1cb04 commit 387e2fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
17 changes: 13 additions & 4 deletions cove_oc4ids/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,18 @@ def explore_oc4ids(request, pk):
schema_oc4ids = SchemaOC4IDS(lib_cove_oc4ids_config=lib_cove_oc4ids_config)

# This feature is disabled, because `flattened.xlsx` was requested once in 14 days as of 2020-10-06.
# context.update(convert_json(upload_dir, upload_url, file_name, lib_cove_oc4ids_config,
# schema_url=schema_oc4ids.schema_url, replace=True,
# request=request, flatten=True))
# > context.update(
# > convert_json(
# > upload_dir,
# > upload_url,
# > file_name,
# > lib_cove_oc4ids_config,
# > schema_url=schema_oc4ids.schema_url,
# > replace=True,
# > request=request,
# > flatten=True,
# > )
# > )
else:
schema_oc4ids = SchemaOC4IDS(lib_cove_oc4ids_config=lib_cove_oc4ids_config)
context.update(
Expand All @@ -85,7 +94,7 @@ def explore_oc4ids(request, pk):
context = common_checks_oc4ids(context, upload_dir, json_data, schema_oc4ids, lib_cove_oc4ids_config)

for key in ("additional_closed_codelist_values", "additional_open_codelist_values"):
for path_string, codelist_info in context[key].items():
for codelist_info in context[key].values():
if codelist_info["codelist_url"].startswith(schema_oc4ids.codelists):
codelist_info["codelist_url"] = (
"https://standard.open-contracting.org/infrastructure/latest/en/reference/codelists/#"
Expand Down
2 changes: 1 addition & 1 deletion cove_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
VALIDATION_ERROR_LOCATIONS_LENGTH = settings.VALIDATION_ERROR_LOCATIONS_LENGTH
VALIDATION_ERROR_LOCATIONS_SAMPLE = settings.VALIDATION_ERROR_LOCATIONS_SAMPLE
DELETE_FILES_AFTER_DAYS = int(os.getenv("DELETE_FILES_AFTER_DAYS", 90))
DELETE_FILES_AFTER_DAYS = int(os.getenv("DELETE_FILES_AFTER_DAYS", "90"))

# We can't take MEDIA_ROOT and MEDIA_URL from cove settings,
# ... otherwise the files appear under the BASE_DIR that is the Cove library install.
Expand Down
3 changes: 1 addition & 2 deletions tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def browser(request):
def server_url(request, live_server):
if "CUSTOM_SERVER_URL" in os.environ:
return os.environ["CUSTOM_SERVER_URL"]
else:
return live_server.url
return live_server.url


@pytest.mark.parametrize(
Expand Down

0 comments on commit 387e2fb

Please sign in to comment.