From 92632b2ef7586758b08cf156fb7088f10337b3f3 Mon Sep 17 00:00:00 2001
From: Oliver Walters <oliver.henry.walters@gmail.com>
Date: Sat, 18 May 2019 16:28:15 +1000
Subject: [PATCH] PartAttachment attachment file is actually required!

---
 .../migrations/0028_auto_20190518_1627.py     | 19 +++++++++++++++++++
 InvenTree/part/models.py                      |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 InvenTree/part/migrations/0028_auto_20190518_1627.py

diff --git a/InvenTree/part/migrations/0028_auto_20190518_1627.py b/InvenTree/part/migrations/0028_auto_20190518_1627.py
new file mode 100644
index 0000000000..fa0fa1457c
--- /dev/null
+++ b/InvenTree/part/migrations/0028_auto_20190518_1627.py
@@ -0,0 +1,19 @@
+# Generated by Django 2.2 on 2019-05-18 06:27
+
+from django.db import migrations, models
+import part.models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('part', '0027_auto_20190518_1620'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='partattachment',
+            name='attachment',
+            field=models.FileField(help_text='Select file to attach', upload_to=part.models.attach_file),
+        ),
+    ]
diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py
index 54ca522cb0..34f9069f91 100644
--- a/InvenTree/part/models.py
+++ b/InvenTree/part/models.py
@@ -641,7 +641,7 @@ class PartAttachment(models.Model):
     part = models.ForeignKey(Part, on_delete=models.CASCADE,
                              related_name='attachments')
 
-    attachment = models.FileField(upload_to=attach_file, null=True, blank=True,
+    attachment = models.FileField(upload_to=attach_file,
                                   help_text='Select file to attach')
 
     comment = models.CharField(max_length=100, help_text='File comment')