2
0
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:
Oliver Walters
2020-04-06 11:16:39 +10:00
parent bd407cd226
commit b28487760a
10 changed files with 39 additions and 24 deletions

View File

@ -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):

View 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',
),
]