mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
fixes for unit testing
This commit is contained in:
parent
0840cebd57
commit
3eb585df27
@ -5,9 +5,9 @@ Provides information on the current InvenTree version
|
|||||||
import subprocess
|
import subprocess
|
||||||
from common.models import InvenTreeSetting
|
from common.models import InvenTreeSetting
|
||||||
|
|
||||||
|
|
||||||
INVENTREE_SW_VERSION = "0.0.10"
|
INVENTREE_SW_VERSION = "0.0.10"
|
||||||
|
|
||||||
|
|
||||||
def inventreeInstanceName():
|
def inventreeInstanceName():
|
||||||
""" Returns the InstanceName settings for the current database """
|
""" Returns the InstanceName settings for the current database """
|
||||||
return InvenTreeSetting.get_setting("InstanceName", "")
|
return InvenTreeSetting.get_setting("InstanceName", "")
|
||||||
|
@ -61,6 +61,7 @@ class CommonConfig(AppConfig):
|
|||||||
# See note above
|
# See note above
|
||||||
from .models import InvenTreeSetting
|
from .models import InvenTreeSetting
|
||||||
|
|
||||||
|
try:
|
||||||
if not InvenTreeSetting.objects.filter(key='InstanceName').exists():
|
if not InvenTreeSetting.objects.filter(key='InstanceName').exists():
|
||||||
|
|
||||||
val = uuid.uuid4().hex
|
val = uuid.uuid4().hex
|
||||||
@ -74,3 +75,6 @@ class CommonConfig(AppConfig):
|
|||||||
)
|
)
|
||||||
|
|
||||||
name.save()
|
name.save()
|
||||||
|
except (OperationalError, ProgrammingError):
|
||||||
|
# Migrations have not yet been applied - table does not exist
|
||||||
|
pass
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Generated by Django 2.2.10 on 2020-04-04 12:38
|
# Generated by Django 2.2.10 on 2020-04-04 12:38
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
from django.db.utils import OperationalError
|
from django.db.utils import OperationalError, ProgrammingError
|
||||||
|
|
||||||
from part.models import Part
|
from part.models import Part
|
||||||
from stdimage.utils import render_variations
|
from stdimage.utils import render_variations
|
||||||
@ -17,8 +17,9 @@ def create_thumbnails(apps, schema_editor):
|
|||||||
# Render thumbnail for each existing Part
|
# Render thumbnail for each existing Part
|
||||||
if part.image:
|
if part.image:
|
||||||
part.image.render_variations()
|
part.image.render_variations()
|
||||||
except OperationalError:
|
except (OperationalError, ProgrammingError):
|
||||||
print("Error - could not generate Part thumbnails")
|
# Migrations have not yet been applied - table does not exist
|
||||||
|
print("Could not generate Part thumbnails")
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user