Skip to content

Commit

Permalink
TSS-1971: ERD data first set dataworskpace bug (#854)
Browse files Browse the repository at this point in the history
* Dependabot/pip/pytorch 2.2.0 (#853)

* dependabot/pip/sprint-63-api-1 (#848)

* Bump djangorestframework from 3.14.0 to 3.15.2

Bumps [djangorestframework](https://github.com/encode/django-rest-framework) from 3.14.0 to 3.15.2.
- [Release notes](https://github.com/encode/django-rest-framework/releases)
- [Commits](encode/django-rest-framework@3.14.0...3.15.2)

---
updated-dependencies:
- dependency-name: djangorestframework
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Regenerating requirements.txt file

* Bump certifi from 2023.7.22 to 2024.7.4

Bumps [certifi](https://github.com/certifi/python-certifi) from 2023.7.22 to 2024.7.4.
- [Commits](certifi/python-certifi@2023.07.22...2024.07.04)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Regenerating requirements.txt file

* Bump django from 4.2.11 to 4.2.14

Bumps [django](https://github.com/django/django) from 4.2.11 to 4.2.14.
- [Commits](django/django@4.2.11...4.2.14)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Regenerating requirements.txt file

* Bump sentry-sdk from 1.14.0 to 2.8.0

Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.14.0 to 2.8.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-python@1.14.0...2.8.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Regenerating requirements.txt file

* remove comments

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>

* updated ml pytorch version

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>

* tss-1971: ERD data first set bug

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Uka Osim <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: abarolo <[email protected]>
  • Loading branch information
5 people authored Aug 2, 2024
1 parent 0cb2bbe commit dedf76a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api/barriers/serializers/data_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,12 @@ def get_date_estimated_resolution_date_first_added(self, instance):
estimated_resolution_date__isnull=False
).order_by("history_date")

first = history.values("estimated_resolution_date").first()
first = history.values("history_date").first()

if not first:
return

return first["estimated_resolution_date"].strftime("%Y-%m-%d")
return first["history_date"].strftime("%Y-%m-%d")

def get_overseas_region(self, instance) -> typing.List[str]:
if instance.country:
Expand Down
7 changes: 4 additions & 3 deletions tests/barriers/test_datawarehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,18 +568,19 @@ def test_estimated_resolution_date_first_added(self):
estimated_resolution_date=None,
)
ts1 = date.today()
ts2 = datetime.timedelta(days=10) + ts1
with freezegun.freeze_time(ts1):
barrier.estimated_resolution_date = ts1
barrier.estimated_resolution_date = ts2
barrier.save()

data = DataWorkspaceSerializer(barrier).data
assert data["date_estimated_resolution_date_first_added"] == ts1.strftime(
"%Y-%m-%d"
)

ts2 = ts1 + datetime.timedelta(days=1)
ts3 = ts2 + datetime.timedelta(days=12)
with freezegun.freeze_time(ts2):
barrier.estimated_resolution_date = ts2
barrier.estimated_resolution_date = ts3
barrier.save()

data = DataWorkspaceSerializer(barrier).data
Expand Down

0 comments on commit dedf76a

Please sign in to comment.