[CI] DB Migration Checks (#6517)

* Update imports

- Help prevent circular imports

* Run migration checks against 0.13.5
This commit is contained in:
Oliver 2024-02-19 17:30:40 +11:00 committed by GitHub
parent 3a52a1631d
commit ed95cf2a8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -446,6 +446,13 @@ jobs:
chmod +rw /home/runner/work/InvenTree/db.sqlite3 chmod +rw /home/runner/work/InvenTree/db.sqlite3
invoke migrate invoke migrate
- name: 0.13.5 Database
run: |
rm /home/runner/work/InvenTree/db.sqlite3
cp test-db/stable_0.13.5.sqlite3 /home/runner/work/InvenTree/db.sqlite3
chmod +rw /home/runner/work/InvenTree/db.sqlite3
invoke migrate
platform_ui: platform_ui:
name: Tests - Platform UI name: Tests - Platform UI
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -25,7 +25,6 @@ from taggit.serializers import TaggitSerializer
import common.models as common_models import common.models as common_models
from common.settings import currency_code_default, currency_code_mappings from common.settings import currency_code_default, currency_code_mappings
from InvenTree.fields import InvenTreeRestURLField, InvenTreeURLField from InvenTree.fields import InvenTreeRestURLField, InvenTreeURLField
from InvenTree.helpers_model import download_image_from_url, get_base_url
class EmptySerializer(serializers.Serializer): class EmptySerializer(serializers.Serializer):
@ -455,6 +454,8 @@ class UserCreateSerializer(ExendedUserSerializer):
def create(self, validated_data): def create(self, validated_data):
"""Send an e email to the user after creation.""" """Send an e email to the user after creation."""
from InvenTree.helpers_model import get_base_url
base_url = get_base_url() base_url = get_base_url()
instance = super().create(validated_data) instance = super().create(validated_data)
@ -860,6 +861,8 @@ class RemoteImageMixin(metaclass=serializers.SerializerMetaclass):
- Attempt to download the image and store it against this object instance - Attempt to download the image and store it against this object instance
- Catches and re-throws any errors - Catches and re-throws any errors
""" """
from InvenTree.helpers_model import download_image_from_url
if not url: if not url:
return return