From 4723a7ecbd7f5bb77b440a655b73cf8761001764 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 28 Nov 2023 20:38:45 +0100 Subject: [PATCH 1/6] added pg upgrade faq --- docs/faq.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index 8a14c6f58..be40a286c 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -105,4 +105,19 @@ the time to help solving each one. You can install Tandoor manually but please do not expect me or anyone to help you with that. As a general advice: If you do it manually do NOT change anything at first and slowly work yourself -to your dream setup. \ No newline at end of file +to your dream setup. + +## How can I upgrade postgres (major versions)? +Postgres requires manual intervention when updating from one major version to another. The steps are roughly + +1. use `pg_dumpall` to dump your database into SQL (for Docker `docker-compose exec -T pg_dumpall -U -f /path/to/dump.sql`) +2. stop the DB / down the container +3. move your postgres directory in order to keep it as a backup (e.g. `mv postgres postgres_old`) +4. update postgres to the new major version (for Docker just change the version number and pull) +5. start the db / up the container (do not start tandoor as it will automatically perform the database migrations which will conflict with loading the dump) +6. if not using docker, you might need to create the same postgres user you had in the old database +7. load the postgres dump (for Docker `'/usr/local/bin/docker-compose exec -T psql -U postgres < /path/to/dump.sql`) + +If anything fails, go back to the old postgres version and data directory and try again. + +There are many articles and tools online that might provide a good starting point to help you upgrade [1](https://thomasbandt.com/postgres-docker-major-version-upgrade), [2](https://github.com/tianon/docker-postgres-upgrade), [3](https://github.com/vabene1111/DockerPostgresBackups). \ No newline at end of file From 702c1d67d3b2d13cf471bf9daa1d2ef0f1837dec Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 31 Oct 2023 12:15:30 +0000 Subject: [PATCH 2/6] Bump django-allauth from 0.54.0 to 0.58.1 See the backwards incompatible changes [1]. [1]: https://docs.allauth.org/en/latest/release-notes/recent.html#id10 --- recipes/settings.py | 1 + requirements.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/settings.py b/recipes/settings.py index 86739628f..6a6490b61 100644 --- a/recipes/settings.py +++ b/recipes/settings.py @@ -218,6 +218,7 @@ MIDDLEWARE = [ 'django.middleware.locale.LocaleMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'cookbook.helper.scope_middleware.ScopeMiddleware', + 'allauth.account.middleware.AccountMiddleware', ] if DEBUG_TOOLBAR: diff --git a/requirements.txt b/requirements.txt index 0ebb38752..162f1a1d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,7 +29,7 @@ microdata==0.8.0 Jinja2==3.1.2 django-webpack-loader==1.8.1 git+https://github.com/BITSOLVER/django-js-reverse@071e304fd600107bc64bbde6f2491f1fe049ec82 -django-allauth==0.54.0 +django-allauth==0.58.1 recipe-scrapers==14.52.0 django-scopes==2.0.0 pytest==7.4.3 From 65513a8f6045f1d7a8225aab8cc3f135360eb402 Mon Sep 17 00:00:00 2001 From: Khuslen Misheel Date: Sat, 9 Dec 2023 15:19:40 -0500 Subject: [PATCH 3/6] Sorted by current day in meal plan --- cookbook/templates/base.html | 3 +- vue/src/apps/MealPlanView/MealPlanView.vue | 32 +++++++++++++--------- vue/src/components/RecipeContextMenu.vue | 1 + vue/src/components/print.css | 6 ++++ 4 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 vue/src/components/print.css diff --git a/cookbook/templates/base.html b/cookbook/templates/base.html index 210492309..b0fae6027 100644 --- a/cookbook/templates/base.html +++ b/cookbook/templates/base.html @@ -86,11 +86,12 @@ {% endif %} {% endif %} - + + {% if request.user.userpreference.left_handed %} {% if not request.user.is_authenticated or request.user.userpreference.theme == request.user.userpreference.TANDOOR %} diff --git a/vue/src/apps/MealPlanView/MealPlanView.vue b/vue/src/apps/MealPlanView/MealPlanView.vue index 2f60ae01f..f870ee96d 100644 --- a/vue/src/apps/MealPlanView/MealPlanView.vue +++ b/vue/src/apps/MealPlanView/MealPlanView.vue @@ -363,20 +363,26 @@ export default { } }, mobileSimpleGrid() { - let grid = [] - - if (this.current_period !== null) { - for (const x of Array(7).keys()) { - let moment_date = moment(this.current_period.periodStart).add(x, "d") - grid.push({ - date: moment_date, - create_default_date: moment_date.format("YYYY-MM-DD"), // improve meal plan edit modal to do formatting itself and accept dates - date_label: moment_date.format("dd") + " " + moment_date.format("ll"), - plan_entries: this.plan_items.filter((m) => moment_date.isBetween(moment(m.startDate), moment(m.endDate), 'day', '[]')) - }) - } + let grid = []; + let currentDate = moment(); + for (let x = 0; x < 7; x++) { + let moment_date = currentDate.clone().add(x, "d"); + grid.push({ + date: moment_date, + create_default_date: moment_date.format("YYYY-MM-DD"), + date_label: moment_date.format("dd") + " " + moment_date.format("ll"), + plan_entries: this.plan_items.filter( + (m) => + moment_date.isBetween( + moment(m.startDate), + moment(m.endDate), + 'day', + '[]' + ) + ), + }); } - return grid + return grid; } }, mounted() { diff --git a/vue/src/components/RecipeContextMenu.vue b/vue/src/components/RecipeContextMenu.vue index bf22a952f..d52e3c52b 100644 --- a/vue/src/components/RecipeContextMenu.vue +++ b/vue/src/components/RecipeContextMenu.vue @@ -1,5 +1,6 @@