Skip to content

Commit

Permalink
🚑(deps) update arrow usage for version 1.0
Browse files Browse the repository at this point in the history
Arrow version 1.0 introduces some breaking changes arrow-py/arrow#832
timestamp property has been replaced by int_timestamp
  • Loading branch information
kernicPanel committed Mar 1, 2021
1 parent 4656c58 commit a4d28f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Fix autosuggest to redirect user directly on the course page when a course
entry has been selected from the suggestion dropdown
- Pin `django-treebeard` to `4.4` as the 4.5 release introduces BC
- Code update to support arrow 1.0

## [2.1.0] - 2021-01-22

Expand Down
6 changes: 3 additions & 3 deletions src/richie/apps/search/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_script_fields(self):
"id": "state",
"params": {
"languages": self.cleaned_data.get("languages") or None,
"ms_since_epoch": arrow.utcnow().timestamp * 1000,
"ms_since_epoch": arrow.utcnow().int_timestamp * 1000,
"states": self.states,
"use_case": "field",
},
Expand Down Expand Up @@ -167,8 +167,8 @@ def get_sorting_script(self):
"id": "state",
"params": {
"languages": self.cleaned_data.get("languages") or None,
"max_date": arrow.get(MAXYEAR, 12, 31).timestamp * 1000,
"ms_since_epoch": arrow.utcnow().timestamp * 1000,
"max_date": arrow.get(MAXYEAR, 12, 31).int_timestamp * 1000,
"ms_since_epoch": arrow.utcnow().int_timestamp * 1000,
"states": self.states,
"use_case": "sorting",
},
Expand Down

0 comments on commit a4d28f2

Please sign in to comment.