diff --git a/InvenTree/InvenTree/status_codes.py b/InvenTree/InvenTree/status_codes.py index 44c71ea9ee..a07a8d6f99 100644 --- a/InvenTree/InvenTree/status_codes.py +++ b/InvenTree/InvenTree/status_codes.py @@ -15,8 +15,6 @@ class StatusCode: Render the value as a label. """ - print("Rendering:", key, cls.options) - # If the key cannot be found, pass it back if key not in cls.options.keys(): return key diff --git a/InvenTree/company/migrations/0019_auto_20200413_0642.py b/InvenTree/company/migrations/0019_auto_20200413_0642.py index df022b73ef..2c120b30b4 100644 --- a/InvenTree/company/migrations/0019_auto_20200413_0642.py +++ b/InvenTree/company/migrations/0019_auto_20200413_0642.py @@ -21,6 +21,12 @@ def reverse_association(apps, schema_editor): into the 'manufacturer_name' field. """ + # Exit if there are no SupplierPart objects + # This crucial otherwise the unit test suite fails! + if SupplierPart.objects.count() == 0: + print("No SupplierPart objects - skipping") + return + print("Reversing migration for manufacturer association") try: @@ -49,6 +55,12 @@ def associate_manufacturers(apps, schema_editor): It uses fuzzy pattern matching to help the user out as much as possible. """ + # Exit if there are no SupplierPart objects + # This crucial otherwise the unit test suite fails! + if SupplierPart.objects.count() == 0: + print("No SupplierPart objects - skipping") + return + # Link a 'manufacturer_name' to a 'Company' links = {}