From 746bfd8bca93d601982eefa0566d0d330ffeb160 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 4 Mar 2020 10:29:22 -0500 Subject: [PATCH] Closes #4119: Extend upgrade script to clear expired user sessions --- docs/installation/upgrading.md | 3 +++ docs/release-notes/version-2.7.md | 1 + upgrade.sh | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/docs/installation/upgrading.md b/docs/installation/upgrading.md index bf6497f6d..79f94fd17 100644 --- a/docs/installation/upgrading.md +++ b/docs/installation/upgrading.md @@ -74,6 +74,9 @@ This script: * Installs all required Python packages * Applies any database migrations that were included in the release * Collects all static files to be served by the HTTP service +* Deletes stale content types from the database +* Deletes all expired user sessions from the database +* Clears all cached data to prevent conflicts with the new release !!! note It's possible that the upgrade script will display a notice warning of unreflected database migrations: diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index eea53489e..b884aba82 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -5,6 +5,7 @@ ## Enhancements * [#3949](https://github.com/netbox-community/netbox/issues/3949) - Revised the installation docs and upgrade script to employ a Python virtual environment +* [#4119](https://github.com/netbox-community/netbox/issues/4119) - Extend upgrade script to clear expired user sessions * [#4218](https://github.com/netbox-community/netbox/issues/4218) - Allow negative voltage for DC power feeds * [#4281](https://github.com/netbox-community/netbox/issues/4281) - Allow filtering device component list views by type * [#4284](https://github.com/netbox-community/netbox/issues/4284) - Add MRJ21 port and cable types diff --git a/upgrade.sh b/upgrade.sh index 977d9684d..26fa5d1d6 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -48,6 +48,11 @@ COMMAND="python3 netbox/manage.py remove_stale_contenttypes --no-input" echo "Removing stale content types ($COMMAND)..." eval $COMMAND +# Delete any expired user sessions +COMMAND="python3 netbox/manage.py clearsessions" +echo "Removing expired user sessions ($COMMAND)..." +eval $COMMAND + # Clear all cached data COMMAND="python3 netbox/manage.py invalidate all" echo "Clearing cache data ($COMMAND)..."