mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-21 14:20:54 +00:00
Rename Part.URL -> part.link
- Previous migration needed some tweaking to get it to run... because.. why? - It seems to pass when running manage.py migrate but fails when running manage.py test - Stumped on this one
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
# Generated by Django 2.2.10 on 2020-04-04 12:38
|
||||
|
||||
from django.db import migrations
|
||||
from django.db.utils import OperationalError
|
||||
|
||||
from part.models import Part
|
||||
from stdimage.utils import render_variations
|
||||
@ -11,11 +12,13 @@ def create_thumbnails(apps, schema_editor):
|
||||
Create thumbnails for all existing Part images.
|
||||
"""
|
||||
|
||||
for part in Part.objects.all():
|
||||
# Render thumbnail for each existing Part
|
||||
if part.image:
|
||||
part.image.render_variations()
|
||||
|
||||
try:
|
||||
for part in Part.objects.all():
|
||||
# Render thumbnail for each existing Part
|
||||
if part.image:
|
||||
part.image.render_variations()
|
||||
except OperationalError:
|
||||
print("Error - could not generate Part thumbnails")
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
18
InvenTree/part/migrations/0035_auto_20200406_0045.py
Normal file
18
InvenTree/part/migrations/0035_auto_20200406_0045.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.10 on 2020-04-06 00:45
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('part', '0034_auto_20200404_1238'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='part',
|
||||
old_name='URL',
|
||||
new_name='link',
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user