Skip to content

Commit

Permalink
Add config option to change location sort order and bump dependency v…
Browse files Browse the repository at this point in the history
…ersions
  • Loading branch information
questionlp committed May 2, 2023
1 parent e76c9da commit a1cd325
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changes

## 5.3.0

### Application Changes

- Add `settings.sort_by_venue` configuration setting that is used to determine whether to sort the locations by venue name or by state and city for the `/locations`. Defaults to `false`, which matches the previous behavior.

### Component Changes

- Upgrade Flask from 2.2.3 to 2.3.2
- Upgrade wwdtm from 2.0.9 to 2.1.0

## 5.2.4

### Component Changes
Expand Down
3 changes: 3 additions & 0 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def load_config(
settings_config["time_zone"] = time_zone_string
database_config["time_zone"] = time_zone_string

# Read in setting to override locations sorting
settings_config["sort_by_venue"] = bool(settings_config.get("sort_by_venue", False))

return {
"database": database_config,
"settings": settings_config,
Expand Down
2 changes: 1 addition & 1 deletion app/locations/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def index():
"""View: Locations Index"""
database_connection = mysql.connector.connect(**current_app.config["database"])
location = Location(database_connection=database_connection)
location_list = location.retrieve_all()
location_list = location.retrieve_all(current_app.config["app_settings"]["sort_by_venue"])
database_connection.close()

if not location_list:
Expand Down
2 changes: 1 addition & 1 deletion app/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Copyright (c) 2018-2023 Linh Pham
# stats.wwdt.me is released under the terms of the Apache License 2.0
"""Application Version for Wait Wait Stats Page"""
APP_VERSION = "5.2.4"
APP_VERSION = "5.3.0"
3 changes: 2 additions & 1 deletion config.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"recent_days_back": 31,
"time_zone": "UTC",
"mastodon_url": "",
"mastodon_user": ""
"mastodon_user": "",
"sort_by_venue": false
}
}
5 changes: 2 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ pycodestyle==2.10.0
pytest==7.3.1
black==23.3.0

Flask==2.2.3
Werkzeug==2.2.3
Flask==2.3.2
gunicorn==20.1.0
Markdown==3.4.3

wwdtm==2.0.9
wwdtm==2.1.0
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Flask==2.2.3
Werkzeug==2.2.3
Flask==2.3.2
gunicorn==20.1.0
Markdown==3.4.3

wwdtm==2.0.9
wwdtm==2.1.0

0 comments on commit a1cd325

Please sign in to comment.