Skip to content

Commit

Permalink
Merge pull request #1345 from ScilifelabDataCentre/reporting_file_pat…
Browse files Browse the repository at this point in the history
…h_fix

Fix the path for dds-reporting.csv
  • Loading branch information
i-oden authored Jan 3, 2023
2 parents 170c3a0 + 59e5c4a commit d5a1d15
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,4 @@ Please add a _short_ line describing the PR you make, if the PR implements a spe
- Dependency: Bump `jwcrypto` due to CVE-2022-3102 ([#1339](https://github.com/ScilifelabDataCentre/dds_web/pull/1339))
- Cronjob: Get number of units and users for reporting ([#1324](https://github.com/ScilifelabDataCentre/dds_web/pull/1335))
- Add ability to change project information via ProjectInfo endpoint ([#1331](https://github.com/ScilifelabDataCentre/dds_web/pull/1331))
- Fix the reporting file path ([1345](https://github.com/ScilifelabDataCentre/dds_web/pull/1345))
2 changes: 1 addition & 1 deletion dds_web/scheduled_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def reporting_units_and_users():
current_date: str = utils.timestamp(ts_format="%Y-%m-%d")

# Location of reporting file
reporting_file: pathlib.Path = pathlib.Path("doc/reporting/dds-reporting.csv")
reporting_file: pathlib.Path = pathlib.Path("/code/doc/reporting/dds-reporting.csv")

# Error default
error: str = None
Expand Down
1 change: 1 addition & 0 deletions doc/reporting/dds-reporting.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Date,Units using DDS in production,Researchers,Unit users,Total number of users
2022-11-30,2,108,11,119
2023-01-02,2,126,11,137
2 changes: 1 addition & 1 deletion tests/test_scheduled_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_quarterly_usage(client: flask.testing.FlaskClient) -> None:
def test_reporting_units_and_users(client: flask.testing.FlaskClient, fs: FakeFilesystem) -> None:
"""Test that the reporting is giving correct values."""
# Create reporting file
reporting_file: pathlib.Path = pathlib.Path("doc/reporting/dds-reporting.csv")
reporting_file: pathlib.Path = pathlib.Path("/code/doc/reporting/dds-reporting.csv")
assert not fs.exists(reporting_file)
fs.create_file(reporting_file)
assert fs.exists(reporting_file)
Expand Down

0 comments on commit d5a1d15

Please sign in to comment.