Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Make addresses optional in admin

Patryk Zawadzki43ebaf95e52b
diff --git a/saleor/userprofile/migrations/0002_auto_20150907_0602.py b/saleor/userprofile/migrations/0002_auto_20150907_0602.py
new file mode 100644
index 0000000000..8ac775e484
--- /dev/null
+++ b/saleor/userprofile/migrations/0002_auto_20150907_0602.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('userprofile', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='user',
+ name='addresses',
+ field=models.ManyToManyField(to='userprofile.Address', blank=True),
+ ),
+ ]
diff --git a/saleor/userprofile/models.py b/saleor/userprofile/models.py
index e09c99e2be..b5ac45071c 100644
--- a/saleor/userprofile/models.py
+++ b/saleor/userprofile/models.py
@@ -110,7 +110,7 @@ class UserManager(BaseUserManager):
@python_2_unicode_compatible
class User(PermissionsMixin, models.Model):
email = models.EmailField(unique=True)
- addresses = models.ManyToManyField(Address)
+ addresses = models.ManyToManyField(Address, blank=True)
is_staff = models.BooleanField(
pgettext_lazy('User field', 'staff status'),
default=False)