From e2e0ecc674c23f3820bf60ba5fa09bbf46c194f6 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 22 Nov 2024 09:51:44 +1100 Subject: [PATCH 1/2] Remove dummy migration file (#8537) --- src/backend/InvenTree/InvenTree/test_tasks.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/backend/InvenTree/InvenTree/test_tasks.py b/src/backend/InvenTree/InvenTree/test_tasks.py index 03e4d6ee0e..803a2832e5 100644 --- a/src/backend/InvenTree/InvenTree/test_tasks.py +++ b/src/backend/InvenTree/InvenTree/test_tasks.py @@ -143,6 +143,13 @@ class InvenTreeTaskTests(TestCase): os.environ['INVENTREE_AUTO_UPDATE'] = 'True' InvenTree.tasks.check_for_migrations() + # List all current migrations for the InvenTree app + migration_dir = os.path.join( + os.path.dirname(os.path.abspath(__file__)), 'migrations' + ) + + migration_files = os.listdir(migration_dir) + # Create migration self.assertEqual(len(InvenTree.tasks.get_migration_plan()), 0) call_command('makemigrations', ['InvenTree', '--empty'], interactive=False) @@ -165,6 +172,19 @@ class InvenTreeTaskTests(TestCase): except IndexError: # pragma: no cover pass + # Let's remove the newly created migration file + for fn in os.listdir(migration_dir): + fn = os.path.join(migration_dir, fn) + + if ( + os.path.isfile(fn) + and fn not in migration_files + and 'auto' in fn + and fn.endswith('.py') + ): + print('Removing dummy migration file:', fn) + os.remove(fn) + def test_failed_task_notification(self): """Test that a failed task will generate a notification.""" from common.models import NotificationEntry, NotificationMessage From f6124fc4a13b35466342246ff06f8f3e8c80a4c5 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 24 Nov 2024 15:50:23 +1100 Subject: [PATCH 2/2] Add info on --skip-backup (#8541) --- docs/docs/faq.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/docs/faq.md b/docs/docs/faq.md index 0b3afe9d55..4904124ed4 100644 --- a/docs/docs/faq.md +++ b/docs/docs/faq.md @@ -67,6 +67,22 @@ For more information, refer to the installation guides: Before performing an update, check the release notes! Any *breaking changes* (changes which require user intervention) will be clearly noted. +### Cannot import name get_storage_class + +When running an install or update, you may see an error similar to: + +```python +ImportError: cannot import name 'get_storage_class' from 'django.core.files.storage' +``` + +In such a situation, it is likely that the automatic backup procedure is unable to run, as the required python packages are not yet installed or are unavailable. + +To proceed in this case, you can skip the backup procedure by running the `invoke update` command with the `--skip-backup` flag: + +```bash +invoke update --skip-backup +``` + ### Feature *x* does not work after update If a particular menu / item is not visible after updating InvenTree, or a certain function no longer seems to work, it may be due to your internet browser caching old versions of CSS and JavaScript files.