Skip to content

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

Rename userprofile app to account app

Anna Siwikd73c476e8ddc
diff --git a/saleor/userprofile/__init__.py b/saleor/account/__init__.py
similarity index 100%
rename from saleor/userprofile/__init__.py
rename to saleor/account/__init__.py
diff --git a/saleor/userprofile/forms.py b/saleor/account/forms.py
similarity index 100%
rename from saleor/userprofile/forms.py
rename to saleor/account/forms.py
diff --git a/saleor/userprofile/i18n.py b/saleor/account/i18n.py
similarity index 100%
rename from saleor/userprofile/i18n.py
rename to saleor/account/i18n.py
diff --git a/saleor/userprofile/impersonate.py b/saleor/account/impersonate.py
similarity index 87%
rename from saleor/userprofile/impersonate.py
rename to saleor/account/impersonate.py
index e5cbfb3c63..470180b023 100644
--- a/saleor/userprofile/impersonate.py
+++ b/saleor/account/impersonate.py
@@ -13,4 +13,4 @@ def can_impersonate(request):
`django-impersonate` module requires a function as input argument,
not just permission name.
"""
- return request.user.has_perm('userprofile.impersonate_user')
+ return request.user.has_perm('account.impersonate_user')
diff --git a/saleor/userprofile/management/__init__.py b/saleor/account/management/__init__.py
similarity index 100%
rename from saleor/userprofile/management/__init__.py
rename to saleor/account/management/__init__.py
diff --git a/saleor/userprofile/management/commands/__init__.py b/saleor/account/management/commands/__init__.py
similarity index 100%
rename from saleor/userprofile/management/commands/__init__.py
rename to saleor/account/management/commands/__init__.py
diff --git a/saleor/userprofile/management/commands/changepassword.py b/saleor/account/management/commands/changepassword.py
similarity index 100%
rename from saleor/userprofile/management/commands/changepassword.py
rename to saleor/account/management/commands/changepassword.py
diff --git a/saleor/userprofile/management/commands/createsuperuser.py b/saleor/account/management/commands/createsuperuser.py
similarity index 100%
rename from saleor/userprofile/management/commands/createsuperuser.py
rename to saleor/account/management/commands/createsuperuser.py
diff --git a/saleor/userprofile/migrations/0001_initial.py b/saleor/account/migrations/0001_initial.py
similarity index 98%
rename from saleor/userprofile/migrations/0001_initial.py
rename to saleor/account/migrations/0001_initial.py
index 149a7b4e0a..82540faaf5 100644
--- a/saleor/userprofile/migrations/0001_initial.py
+++ b/saleor/account/migrations/0001_initial.py
@@ -48,17 +48,17 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='user',
name='addresses',
- field=models.ManyToManyField(to='userprofile.Address'),
+ field=models.ManyToManyField(to='account.Address'),
),
migrations.AddField(
model_name='user',
name='default_billing_address',
- field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='default billing address', blank=True, to='userprofile.Address', null=True),
+ field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='default billing address', blank=True, to='account.Address', null=True),
),
migrations.AddField(
model_name='user',
name='default_shipping_address',
- field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='default shipping address', blank=True, to='userprofile.Address', null=True),
+ field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='default shipping address', blank=True, to='account.Address', null=True),
),
migrations.AddField(
model_name='user',
diff --git a/saleor/userprofile/migrations/0002_auto_20150907_0602.py b/saleor/account/migrations/0002_auto_20150907_0602.py
similarity index 71%
rename from saleor/userprofile/migrations/0002_auto_20150907_0602.py
rename to saleor/account/migrations/0002_auto_20150907_0602.py
index 8ac775e484..85e33238cc 100644
--- a/saleor/userprofile/migrations/0002_auto_20150907_0602.py
+++ b/saleor/account/migrations/0002_auto_20150907_0602.py
@@ -7,13 +7,13 @@ from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0001_initial'),
+ ('account', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='addresses',
- field=models.ManyToManyField(to='userprofile.Address', blank=True),
+ field=models.ManyToManyField(to='account.Address', blank=True),
),
]
diff --git a/saleor/userprofile/migrations/0003_auto_20151104_1102.py b/saleor/account/migrations/0003_auto_20151104_1102.py
similarity index 91%
rename from saleor/userprofile/migrations/0003_auto_20151104_1102.py
rename to saleor/account/migrations/0003_auto_20151104_1102.py
index 7f563286b2..314c955805 100644
--- a/saleor/userprofile/migrations/0003_auto_20151104_1102.py
+++ b/saleor/account/migrations/0003_auto_20151104_1102.py
@@ -7,7 +7,7 @@ from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0002_auto_20150907_0602'),
+ ('account', '0002_auto_20150907_0602'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0004_auto_20160114_0419.py b/saleor/account/migrations/0004_auto_20160114_0419.py
similarity index 90%
rename from saleor/userprofile/migrations/0004_auto_20160114_0419.py
rename to saleor/account/migrations/0004_auto_20160114_0419.py
index f0f9c3cb93..543bb90abd 100644
--- a/saleor/userprofile/migrations/0004_auto_20160114_0419.py
+++ b/saleor/account/migrations/0004_auto_20160114_0419.py
@@ -9,7 +9,7 @@ import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0003_auto_20151104_1102'),
+ ('account', '0003_auto_20151104_1102'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0005_auto_20160205_0651.py b/saleor/account/migrations/0005_auto_20160205_0651.py
similarity index 92%
rename from saleor/userprofile/migrations/0005_auto_20160205_0651.py
rename to saleor/account/migrations/0005_auto_20160205_0651.py
index 6f50a707ec..34c13ef6a2 100644
--- a/saleor/userprofile/migrations/0005_auto_20160205_0651.py
+++ b/saleor/account/migrations/0005_auto_20160205_0651.py
@@ -8,7 +8,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0004_auto_20160114_0419'),
+ ('account', '0004_auto_20160114_0419'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0006_auto_20160829_0819.py b/saleor/account/migrations/0006_auto_20160829_0819.py
similarity index 92%
rename from saleor/userprofile/migrations/0006_auto_20160829_0819.py
rename to saleor/account/migrations/0006_auto_20160829_0819.py
index 6fe664c82f..45c3934b38 100644
--- a/saleor/userprofile/migrations/0006_auto_20160829_0819.py
+++ b/saleor/account/migrations/0006_auto_20160829_0819.py
@@ -8,7 +8,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0005_auto_20160205_0651'),
+ ('account', '0005_auto_20160205_0651'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0007_auto_20161115_0940.py b/saleor/account/migrations/0007_auto_20161115_0940.py
similarity index 92%
rename from saleor/userprofile/migrations/0007_auto_20161115_0940.py
rename to saleor/account/migrations/0007_auto_20161115_0940.py
index 1491ecfe0a..58580b529d 100644
--- a/saleor/userprofile/migrations/0007_auto_20161115_0940.py
+++ b/saleor/account/migrations/0007_auto_20161115_0940.py
@@ -8,7 +8,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0006_auto_20160829_0819'),
+ ('account', '0006_auto_20160829_0819'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0008_auto_20161115_1011.py b/saleor/account/migrations/0008_auto_20161115_1011.py
similarity index 89%
rename from saleor/userprofile/migrations/0008_auto_20161115_1011.py
rename to saleor/account/migrations/0008_auto_20161115_1011.py
index 2fcd027b08..58358ea453 100644
--- a/saleor/userprofile/migrations/0008_auto_20161115_1011.py
+++ b/saleor/account/migrations/0008_auto_20161115_1011.py
@@ -8,7 +8,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0007_auto_20161115_0940'),
+ ('account', '0007_auto_20161115_0940'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0009_auto_20170206_0407.py b/saleor/account/migrations/0009_auto_20170206_0407.py
similarity index 84%
rename from saleor/userprofile/migrations/0009_auto_20170206_0407.py
rename to saleor/account/migrations/0009_auto_20170206_0407.py
index e4cc15e24c..2c72b2779e 100644
--- a/saleor/userprofile/migrations/0009_auto_20170206_0407.py
+++ b/saleor/account/migrations/0009_auto_20170206_0407.py
@@ -8,7 +8,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0008_auto_20161115_1011'),
+ ('account', '0008_auto_20161115_1011'),
]
operations = [
@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='user',
name='addresses',
- field=models.ManyToManyField(blank=True, to='userprofile.Address', verbose_name='addresses'),
+ field=models.ManyToManyField(blank=True, to='account.Address', verbose_name='addresses'),
),
migrations.AlterField(
model_name='user',
diff --git a/saleor/userprofile/migrations/0010_auto_20170919_0839.py b/saleor/account/migrations/0010_auto_20170919_0839.py
similarity index 90%
rename from saleor/userprofile/migrations/0010_auto_20170919_0839.py
rename to saleor/account/migrations/0010_auto_20170919_0839.py
index e8b1e9f594..5a1683e39d 100644
--- a/saleor/userprofile/migrations/0010_auto_20170919_0839.py
+++ b/saleor/account/migrations/0010_auto_20170919_0839.py
@@ -8,7 +8,7 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0009_auto_20170206_0407'),
+ ('account', '0009_auto_20170206_0407'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0011_auto_20171110_0552.py b/saleor/account/migrations/0011_auto_20171110_0552.py
similarity index 92%
rename from saleor/userprofile/migrations/0011_auto_20171110_0552.py
rename to saleor/account/migrations/0011_auto_20171110_0552.py
index fe7468e642..09dcec90c2 100644
--- a/saleor/userprofile/migrations/0011_auto_20171110_0552.py
+++ b/saleor/account/migrations/0011_auto_20171110_0552.py
@@ -8,7 +8,7 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0010_auto_20170919_0839'),
+ ('account', '0010_auto_20170919_0839'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0012_auto_20171117_0846.py b/saleor/account/migrations/0012_auto_20171117_0846.py
similarity index 92%
rename from saleor/userprofile/migrations/0012_auto_20171117_0846.py
rename to saleor/account/migrations/0012_auto_20171117_0846.py
index ef55412b6a..b0e541bbed 100644
--- a/saleor/userprofile/migrations/0012_auto_20171117_0846.py
+++ b/saleor/account/migrations/0012_auto_20171117_0846.py
@@ -8,7 +8,7 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0011_auto_20171110_0552'),
+ ('account', '0011_auto_20171110_0552'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0013_auto_20171120_0521.py b/saleor/account/migrations/0013_auto_20171120_0521.py
similarity index 91%
rename from saleor/userprofile/migrations/0013_auto_20171120_0521.py
rename to saleor/account/migrations/0013_auto_20171120_0521.py
index 77fd9c9477..25aa2be68a 100644
--- a/saleor/userprofile/migrations/0013_auto_20171120_0521.py
+++ b/saleor/account/migrations/0013_auto_20171120_0521.py
@@ -9,7 +9,7 @@ import phonenumbers
def convert_phone_number_to_phonenumberfield(apps, schema_editor):
- Address = apps.get_model("userprofile", "Address")
+ Address = apps.get_model("account", "Address")
for address in Address.objects.all():
if address.phone:
try:
@@ -25,7 +25,7 @@ def convert_phone_number_to_phonenumberfield(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0012_auto_20171117_0846'),
+ ('account', '0012_auto_20171117_0846'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0014_auto_20171129_1004.py b/saleor/account/migrations/0014_auto_20171129_1004.py
similarity index 93%
rename from saleor/userprofile/migrations/0014_auto_20171129_1004.py
rename to saleor/account/migrations/0014_auto_20171129_1004.py
index 0d2a2dd2e3..9447590c11 100644
--- a/saleor/userprofile/migrations/0014_auto_20171129_1004.py
+++ b/saleor/account/migrations/0014_auto_20171129_1004.py
@@ -8,7 +8,7 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0013_auto_20171120_0521'),
+ ('account', '0013_auto_20171120_0521'),
]
operations = [
diff --git a/saleor/userprofile/migrations/0015_auto_20171213_0734.py b/saleor/account/migrations/0015_auto_20171213_0734.py
similarity index 60%
rename from saleor/userprofile/migrations/0015_auto_20171213_0734.py
rename to saleor/account/migrations/0015_auto_20171213_0734.py
index fa8d6a7bbb..de00b6adb2 100644
--- a/saleor/userprofile/migrations/0015_auto_20171213_0734.py
+++ b/saleor/account/migrations/0015_auto_20171213_0734.py
@@ -3,19 +3,19 @@
from __future__ import unicode_literals
from django.db import migrations
-import saleor.userprofile.models
+import saleor.account.models
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0014_auto_20171129_1004'),
+ ('account', '0014_auto_20171129_1004'),
]
operations = [
migrations.AlterField(
model_name='address',
name='phone',
- field=saleor.userprofile.models.PossiblePhoneNumberField(blank=True, default='', max_length=128, verbose_name='phone number'),
+ field=saleor.account.models.PossiblePhoneNumberField(blank=True, default='', max_length=128, verbose_name='phone number'),
),
]
diff --git a/saleor/userprofile/migrations/0016_auto_20180108_0814.py b/saleor/account/migrations/0016_auto_20180108_0814.py
similarity index 88%
rename from saleor/userprofile/migrations/0016_auto_20180108_0814.py
rename to saleor/account/migrations/0016_auto_20180108_0814.py
index 2af2659a7e..b1b3d7ae6f 100644
--- a/saleor/userprofile/migrations/0016_auto_20180108_0814.py
+++ b/saleor/account/migrations/0016_auto_20180108_0814.py
@@ -6,13 +6,13 @@ from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_countries.fields
-import saleor.userprofile.models
+import saleor.account.models
class Migration(migrations.Migration):
dependencies = [
- ('userprofile', '0015_auto_20171213_0734'),
+ ('account', '0015_auto_20171213_0734'),
]
operations = [
@@ -54,7 +54,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='address',
name='phone',
- field=saleor.userprofile.models.PossiblePhoneNumberField(blank=True, default='', max_length=128),
+ field=saleor.account.models.PossiblePhoneNumberField(blank=True, default='', max_length=128),
),
migrations.AlterField(
model_name='address',
@@ -74,7 +74,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='user',
name='addresses',
- field=models.ManyToManyField(blank=True, to='userprofile.Address'),
+ field=models.ManyToManyField(blank=True, to='account.Address'),
),
migrations.AlterField(
model_name='user',
@@ -84,12 +84,12 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='user',
name='default_billing_address',
- field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='userprofile.Address'),
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='account.Address'),
),
migrations.AlterField(
model_name='user',
name='default_shipping_address',
- field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='userprofile.Address'),
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='account.Address'),
),
migrations.AlterField(
model_name='user',
diff --git a/saleor/userprofile/migrations/__init__.py b/saleor/account/migrations/__init__.py
similarity index 100%
rename from saleor/userprofile/migrations/__init__.py
rename to saleor/account/migrations/__init__.py
diff --git a/saleor/userprofile/models.py b/saleor/account/models.py
similarity index 100%
rename from saleor/userprofile/models.py
rename to saleor/account/models.py
diff --git a/saleor/userprofile/templatetags/__init__.py b/saleor/account/templatetags/__init__.py
similarity index 100%
rename from saleor/userprofile/templatetags/__init__.py
rename to saleor/account/templatetags/__init__.py
diff --git a/saleor/userprofile/templatetags/i18n_address_tags.py b/saleor/account/templatetags/i18n_address_tags.py
similarity index 100%
rename from saleor/userprofile/templatetags/i18n_address_tags.py
rename to saleor/account/templatetags/i18n_address_tags.py
diff --git a/saleor/userprofile/urls.py b/saleor/account/urls.py
similarity index 100%
rename from saleor/userprofile/urls.py
rename to saleor/account/urls.py
diff --git a/saleor/userprofile/utils.py b/saleor/account/utils.py
similarity index 100%
rename from saleor/userprofile/utils.py
rename to saleor/account/utils.py
diff --git a/saleor/userprofile/validators.py b/saleor/account/validators.py
similarity index 100%
rename from saleor/userprofile/validators.py
rename to saleor/account/validators.py
diff --git a/saleor/userprofile/views.py b/saleor/account/views.py
similarity index 92%
rename from saleor/userprofile/views.py
rename to saleor/account/views.py
index b5304e9b05..374b105c09 100755
--- a/saleor/userprofile/views.py
+++ b/saleor/account/views.py
@@ -22,7 +22,7 @@ def details(request):
'orders': orders_paginated,
'change_password_form': password_form}
- return TemplateResponse(request, 'userprofile/details.html', ctx)
+ return TemplateResponse(request, 'account/details.html', ctx)
def get_or_process_password_form(request):
@@ -48,7 +48,7 @@ def address_edit(request, pk):
messages.success(request, message)
return HttpResponseRedirect(reverse('profile:details') + '#addresses')
return TemplateResponse(
- request, 'userprofile/address_edit.html',
+ request, 'account/address_edit.html',
{'address_form': address_form})
@@ -62,4 +62,4 @@ def address_delete(request, pk):
pgettext('Storefront message', 'Address successfully removed'))
return HttpResponseRedirect(reverse('profile:details') + '#addresses')
return TemplateResponse(
- request, 'userprofile/address_delete.html', {'address': address})
+ request, 'account/address_delete.html', {'address': address})
diff --git a/saleor/userprofile/widgets.py b/saleor/account/widgets.py
similarity index 89%
rename from saleor/userprofile/widgets.py
rename to saleor/account/widgets.py
index dc4c6a6ff3..d6857861c7 100644
--- a/saleor/userprofile/widgets.py
+++ b/saleor/account/widgets.py
@@ -14,7 +14,7 @@ class PhonePrefixWidget(PhoneNumberPrefixWidget):
https://github.com/stefanfoulis/django-phonenumber-field/issues/82
"""
- template_name = 'userprofile/snippets/phone_prefix_widget.html'
+ template_name = 'account/snippets/phone_prefix_widget.html'
def __init__(self, attrs=None):
widgets = (Select(attrs=attrs, choices=phone_prefixes), TextInput())
@@ -23,7 +23,7 @@ class PhonePrefixWidget(PhoneNumberPrefixWidget):
class DatalistTextWidget(Select):
- template_name = "userprofile/snippets/datalist.html"
+ template_name = "account/snippets/datalist.html"
input_type = "text"
def get_context(self, *args):
diff --git a/saleor/checkout/core.py b/saleor/checkout/core.py
index 30984a7cc2..97c3d04ed0 100644
--- a/saleor/checkout/core.py
+++ b/saleor/checkout/core.py
@@ -16,8 +16,8 @@ from ..discount.models import NotApplicable, Voucher
from ..discount.utils import increase_voucher_usage
from ..order.models import Order
from ..shipping.models import ANY_COUNTRY, ShippingMethodCountry
-from ..userprofile.models import Address
-from ..userprofile.utils import store_user_address
+from ..account.models import Address
+from ..account.utils import store_user_address
STORAGE_SESSION_KEY = 'checkout_storage'
diff --git a/saleor/checkout/views/shipping.py b/saleor/checkout/views/shipping.py
index f4fc30af6d..3c3da5ad14 100644
--- a/saleor/checkout/views/shipping.py
+++ b/saleor/checkout/views/shipping.py
@@ -1,8 +1,8 @@
from django.shortcuts import redirect
from django.template.response import TemplateResponse
-from ...userprofile.forms import get_address_form
-from ...userprofile.models import Address
+from ...account.forms import get_address_form
+from ...account.models import Address
from ..forms import AnonymousUserShippingForm, ShippingAddressesForm
diff --git a/saleor/checkout/views/summary.py b/saleor/checkout/views/summary.py
index f18e475c7c..36c0c34670 100644
--- a/saleor/checkout/views/summary.py
+++ b/saleor/checkout/views/summary.py
@@ -4,8 +4,8 @@ from django.template.response import TemplateResponse
from django.utils.translation import pgettext, pgettext_lazy
from satchless.item import InsufficientStock
-from ...userprofile.forms import get_address_form
-from ...userprofile.models import Address
+from ...account.forms import get_address_form
+from ...account.models import Address
from ..forms import (
AnonymousUserBillingForm, BillingAddressesForm,
BillingWithoutShippingAddressForm, NoteForm)
diff --git a/saleor/core/utils/__init__.py b/saleor/core/utils/__init__.py
index ec0b7db1d9..330a346f37 100644
--- a/saleor/core/utils/__init__.py
+++ b/saleor/core/utils/__init__.py
@@ -15,7 +15,7 @@ from django_prices_openexchangerates import exchange_currency
from geolite2 import geolite2
from prices import PriceRange
-from ...userprofile.models import User
+from ...account.models import User
georeader = geolite2.reader()
diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py
index 5478bfebee..a76ae48f25 100644
--- a/saleor/core/utils/random_data.py
+++ b/saleor/core/utils/random_data.py
@@ -21,8 +21,8 @@ from ...product.models import (
AttributeChoiceValue, Category, Collection, Product, ProductAttribute,
ProductImage, ProductType, ProductVariant, Stock, StockLocation)
from ...shipping.models import ANY_COUNTRY, ShippingMethod
-from ...userprofile.models import Address, User
-from ...userprofile.utils import store_user_address
+from ...account.models import Address, User
+from ...account.utils import store_user_address
fake = Factory.create()
STOCK_LOCATION = 'default'
diff --git a/saleor/core/views.py b/saleor/core/views.py
index a67eb74ca1..ef3ae0c273 100644
--- a/saleor/core/views.py
+++ b/saleor/core/views.py
@@ -7,7 +7,7 @@ from impersonate.views import impersonate as orig_impersonate
from ..dashboard.views import staff_member_required
from ..product.utils import products_for_homepage, products_with_availability
-from ..userprofile.models import User
+from ..account.models import User
from .utils.schema import get_webpage_schema
diff --git a/saleor/dashboard/customer/filters.py b/saleor/dashboard/customer/filters.py
index c0f32eb8cf..3ad702b7ac 100644
--- a/saleor/dashboard/customer/filters.py
+++ b/saleor/dashboard/customer/filters.py
@@ -5,7 +5,7 @@ from django_countries import countries
from django_filters import CharFilter, ChoiceFilter, OrderingFilter
from ...core.filters import SortedFilterSet
-from ...userprofile.models import User
+from ...account.models import User
SORT_BY_FIELDS = (
('email', 'email'),
diff --git a/saleor/dashboard/customer/forms.py b/saleor/dashboard/customer/forms.py
index 31acf87e19..0229456b77 100644
--- a/saleor/dashboard/customer/forms.py
+++ b/saleor/dashboard/customer/forms.py
@@ -1,6 +1,6 @@
from django import forms
-from ...userprofile.models import User
+from ...account.models import User
class CustomerForm(forms.ModelForm):
diff --git a/saleor/dashboard/customer/views.py b/saleor/dashboard/customer/views.py
index eba1fc712b..020c88aa3b 100644
--- a/saleor/dashboard/customer/views.py
+++ b/saleor/dashboard/customer/views.py
@@ -7,7 +7,7 @@ from django.template.response import TemplateResponse
from django.utils.translation import pgettext_lazy
from ...core.utils import get_paginator_items
-from ...userprofile.models import User
+from ...account.models import User
from ..emails import send_set_password_email
from ..views import staff_member_required
from .filters import UserFilter
@@ -15,7 +15,7 @@ from .forms import CustomerForm
@staff_member_required
-@permission_required('userprofile.view_user')
+@permission_required('account.view_user')
def customer_list(request):
customers = (
User.objects
@@ -36,7 +36,7 @@ def customer_list(request):
@staff_member_required
-@permission_required('userprofile.view_user')
+@permission_required('account.view_user')
def customer_details(request, pk):
queryset = User.objects.prefetch_related(
'orders', 'addresses').select_related(
@@ -48,7 +48,7 @@ def customer_details(request, pk):
@staff_member_required
-@permission_required('userprofile.edit_user')
+@permission_required('account.edit_user')
def customer_create(request):
customer = User()
form = CustomerForm(request.POST or None, instance=customer)
@@ -64,7 +64,7 @@ def customer_create(request):
@staff_member_required
-@permission_required('userprofile.edit_user')
+@permission_required('account.edit_user')
def customer_edit(request, pk=None):
customer = get_object_or_404(User, pk=pk)
form = CustomerForm(request.POST or None, instance=customer)
diff --git a/saleor/dashboard/group/views.py b/saleor/dashboard/group/views.py
index a4e40a84a9..62fd7401cb 100644
--- a/saleor/dashboard/group/views.py
+++ b/saleor/dashboard/group/views.py
@@ -13,7 +13,7 @@ from .forms import GroupPermissionsForm
@staff_member_required
-@permission_required('userprofile.view_group')
+@permission_required('account.view_group')
def group_list(request):
groups = (Group.objects.all().prefetch_related('permissions')
.order_by('name'))
@@ -29,7 +29,7 @@ def group_list(request):
@staff_member_required
-@permission_required('userprofile.edit_group')
+@permission_required('account.edit_group')
def group_create(request):
group = Group()
form = GroupPermissionsForm(request.POST or None)
@@ -43,7 +43,7 @@ def group_create(request):
@staff_member_required
-@permission_required('userprofile.edit_group')
+@permission_required('account.edit_group')
def group_details(request, pk):
group = Group.objects.get(pk=pk)
form = GroupPermissionsForm(request.POST or None, instance=group)
@@ -58,7 +58,7 @@ def group_details(request, pk):
@staff_member_required
-@permission_required('userprofile.edit_group')
+@permission_required('account.edit_group')
def group_delete(request, pk):
group = get_object_or_404(Group, pk=pk)
if request.method == 'POST':
diff --git a/saleor/dashboard/order/forms.py b/saleor/dashboard/order/forms.py
index 89729c5ba2..f92026e850 100644
--- a/saleor/dashboard/order/forms.py
+++ b/saleor/dashboard/order/forms.py
@@ -19,7 +19,7 @@ from ...order.utils import (
recalculate_order, remove_empty_groups)
from ...product.models import Product, ProductVariant, Stock
from ...product.utils import allocate_stock, deallocate_stock
-from ...userprofile.i18n import (
+from ...account.i18n import (
AddressForm as StorefrontAddressForm, PossiblePhoneNumberFormField)
from ..forms import AjaxSelect2ChoiceField
from ..widgets import PhonePrefixWidget
diff --git a/saleor/dashboard/search/views.py b/saleor/dashboard/search/views.py
index 74549ae382..cbb5bffe5c 100644
--- a/saleor/dashboard/search/views.py
+++ b/saleor/dashboard/search/views.py
@@ -20,7 +20,7 @@ def get_results(request, form):
users = results['users']
if not user.has_perm('order.view_order'):
orders = orders.none()
- if not user.has_perm('userprofile.view_user'):
+ if not user.has_perm('account.view_user'):
users = users.none()
return limit_results(products, orders, users)
diff --git a/saleor/dashboard/staff/filters.py b/saleor/dashboard/staff/filters.py
index 6a231d4044..a2988dc0d0 100644
--- a/saleor/dashboard/staff/filters.py
+++ b/saleor/dashboard/staff/filters.py
@@ -2,7 +2,7 @@ from django.contrib.auth.models import Group
from django.utils.translation import npgettext, pgettext_lazy
from django_filters import ModelMultipleChoiceFilter, OrderingFilter
-from ...userprofile.models import User
+from ...account.models import User
from ..customer.filters import UserFilter
SORT_BY_FIELDS = (
diff --git a/saleor/dashboard/staff/forms.py b/saleor/dashboard/staff/forms.py
index 9aa9262960..d0e7347776 100644
--- a/saleor/dashboard/staff/forms.py
+++ b/saleor/dashboard/staff/forms.py
@@ -1,7 +1,7 @@
from django import forms
from django.utils.translation import pgettext_lazy
-from ...userprofile.models import User
+from ...account.models import User
class StaffForm(forms.ModelForm):
diff --git a/saleor/dashboard/staff/views.py b/saleor/dashboard/staff/views.py
index e742677473..38f2bf5fcb 100644
--- a/saleor/dashboard/staff/views.py
+++ b/saleor/dashboard/staff/views.py
@@ -6,7 +6,7 @@ from django.template.response import TemplateResponse
from django.utils.translation import pgettext_lazy
from ...core.utils import get_paginator_items
-from ...userprofile.models import User
+from ...account.models import User
from ..emails import (
send_promote_customer_to_staff_email, send_set_password_email)
from ..views import staff_member_required
@@ -16,7 +16,7 @@ from .utils import remove_staff_member
@staff_member_required
-@permission_required('userprofile.view_staff')
+@permission_required('account.view_staff')
def staff_list(request):
staff_members = User.objects.filter(is_staff=True).prefetch_related(
'default_billing_address').order_by('email')
@@ -31,7 +31,7 @@ def staff_list(request):
@staff_member_required
-@permission_required('userprofile.edit_staff')
+@permission_required('account.edit_staff')
def staff_details(request, pk):
queryset = User.objects.filter(is_staff=True)
staff_member = get_object_or_404(queryset, pk=pk)
@@ -48,7 +48,7 @@ def staff_details(request, pk):
@staff_member_required
-@permission_required('userprofile.edit_staff')
+@permission_required('account.edit_staff')
def staff_create(request):
try:
staff = User.objects.get(email=request.POST.get('email'))
@@ -72,7 +72,7 @@ def staff_create(request):
@staff_member_required
-@permission_required('userprofile.edit_staff')
+@permission_required('account.edit_staff')
def staff_delete(request, pk):
queryset = User.objects.prefetch_related('orders')
staff = get_object_or_404(queryset, pk=pk)
diff --git a/saleor/dashboard/widgets.py b/saleor/dashboard/widgets.py
index 470921fff6..58336c94af 100644
--- a/saleor/dashboard/widgets.py
+++ b/saleor/dashboard/widgets.py
@@ -4,7 +4,7 @@ from django.forms import Textarea
from django_filters.widgets import RangeWidget
from django_prices.widgets import PriceInput
-from ..userprofile.widgets import (
+from ..account.widgets import (
PhonePrefixWidget as StorefrontPhonePrefixWidget)
diff --git a/saleor/order/migrations/0001_initial.py b/saleor/order/migrations/0001_initial.py
index 64bf138f29..7ee075d380 100644
--- a/saleor/order/migrations/0001_initial.py
+++ b/saleor/order/migrations/0001_initial.py
@@ -15,7 +15,7 @@ class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('product', '0001_initial'),
- ('userprofile', '__first__'),
+ ('account', '__first__'),
]
operations = [
@@ -40,8 +40,8 @@ class Migration(migrations.Migration):
('shipping_method', models.CharField(max_length=255, verbose_name='Delivery method', blank=True)),
('anonymous_user_email', models.EmailField(default='', max_length=254, editable=False, blank=True)),
('token', models.CharField(unique=True, max_length=36, verbose_name='token')),
- ('billing_address', models.ForeignKey(related_name='+', editable=False, to='userprofile.Address', on_delete=django.db.models.deletion.CASCADE)),
- ('shipping_address', models.ForeignKey(related_name='+', editable=False, to='userprofile.Address', null=True, on_delete=django.db.models.deletion.CASCADE)),
+ ('billing_address', models.ForeignKey(related_name='+', editable=False, to='account.Address', on_delete=django.db.models.deletion.CASCADE)),
+ ('shipping_address', models.ForeignKey(related_name='+', editable=False, to='account.Address', null=True, on_delete=django.db.models.deletion.CASCADE)),
('user', models.ForeignKey(related_name='orders', verbose_name='user', blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=django.db.models.deletion.CASCADE)),
],
options={
diff --git a/saleor/order/migrations/0015_auto_20170206_0407.py b/saleor/order/migrations/0015_auto_20170206_0407.py
index 2e87e2925e..5452c3773e 100644
--- a/saleor/order/migrations/0015_auto_20170206_0407.py
+++ b/saleor/order/migrations/0015_auto_20170206_0407.py
@@ -57,7 +57,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='order',
name='billing_address',
- field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='userprofile.Address', verbose_name='billing address'),
+ field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='account.Address', verbose_name='billing address'),
),
migrations.AlterField(
model_name='order',
@@ -72,7 +72,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='order',
name='shipping_address',
- field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='userprofile.Address', verbose_name='shipping address'),
+ field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='account.Address', verbose_name='shipping address'),
),
migrations.AlterField(
model_name='order',
diff --git a/saleor/order/migrations/0019_auto_20171109_1423.py b/saleor/order/migrations/0019_auto_20171109_1423.py
index 76138ab1d2..db24a90116 100644
--- a/saleor/order/migrations/0019_auto_20171109_1423.py
+++ b/saleor/order/migrations/0019_auto_20171109_1423.py
@@ -17,12 +17,12 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='order',
name='billing_address',
- field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='userprofile.Address', verbose_name='billing address'),
+ field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='account.Address', verbose_name='billing address'),
),
migrations.AlterField(
model_name='order',
name='shipping_address',
- field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='userprofile.Address', verbose_name='shipping address'),
+ field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='account.Address', verbose_name='shipping address'),
),
migrations.AlterField(
model_name='order',
diff --git a/saleor/order/migrations/0027_auto_20180108_0814.py b/saleor/order/migrations/0027_auto_20180108_0814.py
index c9039dbc1a..364fa6fba5 100644
--- a/saleor/order/migrations/0027_auto_20180108_0814.py
+++ b/saleor/order/migrations/0027_auto_20180108_0814.py
@@ -40,7 +40,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='order',
name='billing_address',
- field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='userprofile.Address'),
+ field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='account.Address'),
),
migrations.AlterField(
model_name='order',
@@ -65,7 +65,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='order',
name='shipping_address',
- field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='userprofile.Address'),
+ field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='account.Address'),
),
migrations.AlterField(
model_name='order',
diff --git a/saleor/order/models.py b/saleor/order/models.py
index cdcda62861..5b2df499c9 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -19,7 +19,7 @@ from . import GroupStatus, OrderStatus, emails
from ..core.utils import build_absolute_uri
from ..discount.models import Voucher
from ..product.models import Product
-from ..userprofile.models import Address
+from ..account.models import Address
from .transitions import (
cancel_delivery_group, process_delivery_group, ship_delivery_group)
diff --git a/saleor/order/utils.py b/saleor/order/utils.py
index 20759f5ae7..e664acdc6c 100644
--- a/saleor/order/utils.py
+++ b/saleor/order/utils.py
@@ -9,7 +9,7 @@ from satchless.item import InsufficientStock
from . import GroupStatus
from ..product.utils import allocate_stock
-from ..userprofile.utils import store_user_address
+from ..account.utils import store_user_address
def check_order_status(func):
diff --git a/saleor/order/views.py b/saleor/order/views.py
index 32af07de16..e9cd6d35d3 100644
--- a/saleor/order/views.py
+++ b/saleor/order/views.py
@@ -13,7 +13,7 @@ from payments import PaymentStatus, RedirectNeeded
from . import OrderStatus
from ..core.utils import get_client_ip
from ..registration.forms import LoginForm
-from ..userprofile.models import User
+from ..account.models import User
from .forms import (
OrderNoteForm, PasswordForm, PaymentDeleteForm, PaymentMethodsForm)
from .models import Order, OrderNote, Payment
diff --git a/saleor/registration/forms.py b/saleor/registration/forms.py
index 2d6cb1ac04..0a6f2df611 100644
--- a/saleor/registration/forms.py
+++ b/saleor/registration/forms.py
@@ -2,7 +2,7 @@ from django import forms
from django.contrib.auth import forms as django_forms
from django.utils.translation import pgettext, pgettext_lazy
-from ..userprofile.models import User
+from ..account.models import User
from . import emails
diff --git a/saleor/search/backends/postgresql_dashboard.py b/saleor/search/backends/postgresql_dashboard.py
index 03d93048fd..f5c7513789 100644
--- a/saleor/search/backends/postgresql_dashboard.py
+++ b/saleor/search/backends/postgresql_dashboard.py
@@ -3,7 +3,7 @@ from django.contrib.postgres.search import (
from ...order.models import Order
from ...product.models import Product
-from ...userprofile.models import User
+from ...account.models import User
def search_products(phrase):
diff --git a/saleor/search/documents.py b/saleor/search/documents.py
index bf909da5f0..11b64e386b 100644
--- a/saleor/search/documents.py
+++ b/saleor/search/documents.py
@@ -3,7 +3,7 @@ from elasticsearch_dsl import analyzer, token_filter
from ..order.models import Order
from ..product.models import Product
-from ..userprofile.models import User
+from ..account.models import User
storefront = Index('storefront')
storefront.settings(number_of_shards=1, number_of_replicas=0)
diff --git a/saleor/settings.py b/saleor/settings.py
index 3565b054c0..5d081c2c1b 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -154,7 +154,7 @@ INSTALLED_APPS = [
'django.forms',
# Local apps
- 'saleor.userprofile',
+ 'saleor.account',
'saleor.discount',
'saleor.product',
'saleor.cart',
@@ -225,7 +225,7 @@ LOGGING = {
'level': 'DEBUG',
'propagate': True}}}
-AUTH_USER_MODEL = 'userprofile.User'
+AUTH_USER_MODEL = 'account.User'
LOGIN_URL = '/account/login/'
@@ -396,6 +396,6 @@ CELERY_RESULT_BACKEND = 'django-db'
# Impersonate module settings
IMPERSONATE = {
'URI_EXCLUSIONS': [r'^dashboard/'],
- 'CUSTOM_USER_QUERYSET': 'saleor.userprofile.impersonate.get_impersonatable_users', # noqa
+ 'CUSTOM_USER_QUERYSET': 'saleor.account.impersonate.get_impersonatable_users', # noqa
'USE_HTTP_REFERER': True,
- 'CUSTOM_ALLOW': 'saleor.userprofile.impersonate.can_impersonate'}
+ 'CUSTOM_ALLOW': 'saleor.account.impersonate.can_impersonate'}
diff --git a/saleor/urls.py b/saleor/urls.py
index 9d851fb430..634a78c409 100644
--- a/saleor/urls.py
+++ b/saleor/urls.py
@@ -16,7 +16,7 @@ from .order.urls import urlpatterns as order_urls
from .product.urls import urlpatterns as product_urls
from .registration.urls import urlpatterns as registration_urls
from .search.urls import urlpatterns as search_urls
-from .userprofile.urls import urlpatterns as userprofile_urls
+from .account.urls import urlpatterns as userprofile_urls
handler404 = 'saleor.core.views.handle_404'
diff --git a/templates/userprofile/address_delete.html b/templates/account/address_delete.html
similarity index 100%
rename from templates/userprofile/address_delete.html
rename to templates/account/address_delete.html
diff --git a/templates/userprofile/address_edit.html b/templates/account/address_edit.html
similarity index 100%
rename from templates/userprofile/address_edit.html
rename to templates/account/address_edit.html
diff --git a/templates/userprofile/details.html b/templates/account/details.html
similarity index 100%
rename from templates/userprofile/details.html
rename to templates/account/details.html
diff --git a/templates/userprofile/snippets/address_form.html b/templates/account/snippets/address_form.html
similarity index 100%
rename from templates/userprofile/snippets/address_form.html
rename to templates/account/snippets/address_form.html
diff --git a/templates/userprofile/snippets/datalist.html b/templates/account/snippets/datalist.html
similarity index 100%
rename from templates/userprofile/snippets/datalist.html
rename to templates/account/snippets/datalist.html
diff --git a/templates/userprofile/snippets/phone_prefix_widget.html b/templates/account/snippets/phone_prefix_widget.html
similarity index 100%
rename from templates/userprofile/snippets/phone_prefix_widget.html
rename to templates/account/snippets/phone_prefix_widget.html
diff --git a/templates/checkout/summary_without_shipping.html b/templates/checkout/summary_without_shipping.html
index 4336f34b6d..1233ae9ce7 100644
--- a/templates/checkout/summary_without_shipping.html
+++ b/templates/checkout/summary_without_shipping.html
@@ -10,7 +10,7 @@
{% include "checkout/snippets/addresses_form.html" with addresses_form=addresses_form addresses=additional_addresses address_form=address_form only %}
{% else %}
{% bootstrap_form user_form %}
- {% include "userprofile/snippets/address_form.html" with address_form=address_form only %}
+ {% include "account/snippets/address_form.html" with address_form=address_form only %}
{% endif %}
<h2>{% trans "Add a note to your order" context "Checkout summary without shipping note title" %}</h2>
{% bootstrap_form note_form show_label=False %}
@@ -20,4 +20,4 @@
</button>
</p>
</form>
-{% endblock forms %}
\ No newline at end of file
+{% endblock forms %}
diff --git a/tests/conftest.py b/tests/conftest.py
index ae043ad929..11a0843d0a 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -23,7 +23,7 @@ from saleor.product.models import (
ProductImage, ProductType, ProductVariant, Stock, StockLocation)
from saleor.shipping.models import ShippingMethod
from saleor.site.models import AuthorizationKey, SiteSettings
-from saleor.userprofile.models import Address, User
+from saleor.account.models import Address, User
@pytest.fixture(autouse=True)
diff --git a/tests/dashboard/test_permissions.py b/tests/dashboard/test_permissions.py
index 3634c0ce0d..6e4bde6fa2 100644
--- a/tests/dashboard/test_permissions.py
+++ b/tests/dashboard/test_permissions.py
@@ -1,6 +1,6 @@
from django.urls import reverse
-from saleor.userprofile.models import User
+from saleor.account.models import User
def test_admin_can_view_staff_list(admin_client):
@@ -671,13 +671,13 @@ def test_staff_group_member_can_view_billing_address_edit(
def test_staff_group_member_can_view_customers_list(
staff_client, staff_user, staff_group, permission_view_user):
- assert not staff_user.has_perm("userprofile.view_user")
+ assert not staff_user.has_perm("account.view_user")
response = staff_client.get(reverse('dashboard:customers'))
assert response.status_code == 302
staff_group.permissions.add(permission_view_user)
staff_user.groups.add(staff_group)
staff_user = User.objects.get(pk=staff_user.pk)
- assert staff_user.has_perm("userprofile.view_user")
+ assert staff_user.has_perm("account.view_user")
response = staff_client.get(reverse('dashboard:customers'))
assert response.status_code == 200
@@ -685,14 +685,14 @@ def test_staff_group_member_can_view_customers_list(
def test_staff_group_member_can_view_customer_details(
staff_client, staff_user, staff_group, permission_view_user,
customer_user, order_with_lines_and_stock):
- assert not staff_user.has_perm("userprofile.view_user")
+ assert not staff_user.has_perm("account.view_user")
response = staff_client.get(reverse('dashboard:customer-details',
args=[customer_user.pk]))
assert response.status_code == 302
staff_group.permissions.add(permission_view_user)
staff_user.groups.add(staff_group)
staff_user = User.objects.get(pk=staff_user.pk)
- assert staff_user.has_perm("userprofile.view_user")
+ assert staff_user.has_perm("account.view_user")
response = staff_client.get(reverse('dashboard:customer-details',
args=[customer_user.pk]))
assert response.status_code == 200
@@ -703,20 +703,20 @@ def test_staff_group_member_can_view_customer_details(
def test_staff_group_member_can_view_staff_members_list(
staff_client, staff_user, staff_group, permission_view_staff):
- assert not staff_user.has_perm("userprofile.view_staff")
+ assert not staff_user.has_perm("account.view_staff")
response = staff_client.get(reverse('dashboard:staff-list'))
assert response.status_code == 302
staff_group.permissions.add(permission_view_staff)
staff_user.groups.add(staff_group)
staff_user = User.objects.get(pk=staff_user.pk)
- assert staff_user.has_perm("userprofile.view_staff")
+ assert staff_user.has_perm("account.view_staff")
response = staff_client.get(reverse('dashboard:staff-list'))
assert response.status_code == 200
def test_staff_group_member_can_view_detail_create_and_delete_staff_members(
staff_client, staff_user, staff_group, permission_edit_staff):
- assert not staff_user.has_perm("userprofile.edit_staff")
+ assert not staff_user.has_perm("account.edit_staff")
response = staff_client.get(reverse('dashboard:staff-create'))
assert response.status_code == 302
response = staff_client.get(reverse('dashboard:staff-delete',
@@ -728,7 +728,7 @@ def test_staff_group_member_can_view_detail_create_and_delete_staff_members(
staff_group.permissions.add(permission_edit_staff)
staff_user.groups.add(staff_group)
staff_user = User.objects.get(pk=staff_user.pk)
- assert staff_user.has_perm("userprofile.edit_staff")
+ assert staff_user.has_perm("account.edit_staff")
response = staff_client.get(reverse('dashboard:staff-create'))
assert response.status_code == 200
response = staff_client.get(reverse('dashboard:staff-delete',
@@ -741,20 +741,20 @@ def test_staff_group_member_can_view_detail_create_and_delete_staff_members(
def test_staff_group_member_can_view_group_list_and_details(
staff_client, staff_user, staff_group, permission_view_group):
- assert not staff_user.has_perm("userprofile.view_group")
+ assert not staff_user.has_perm("account.view_group")
response = staff_client.get(reverse('dashboard:group-list'))
assert response.status_code == 302
staff_group.permissions.add(permission_view_group)
staff_user.groups.add(staff_group)
staff_user = User.objects.get(pk=staff_user.pk)
- assert staff_user.has_perm("userprofile.view_group")
+ assert staff_user.has_perm("account.view_group")
response = staff_client.get(reverse('dashboard:group-list'))
assert response.status_code == 200
def test_staff_with_permission_can_create_and_delete_group(
staff_client, staff_user, staff_group, permission_edit_group):
- assert not staff_user.has_perm("userprofile.edit_group")
+ assert not staff_user.has_perm("account.edit_group")
response = staff_client.get(reverse('dashboard:group-delete',
args=[staff_group.pk]))
assert response.status_code == 302
@@ -766,7 +766,7 @@ def test_staff_with_permission_can_create_and_delete_group(
staff_group.permissions.add(permission_edit_group)
staff_user.groups.add(staff_group)
staff_user = User.objects.get(pk=staff_user.pk)
- assert staff_user.has_perm("userprofile.edit_group")
+ assert staff_user.has_perm("account.edit_group")
response = staff_client.get(reverse('dashboard:group-details',
args=[staff_group.pk]))
assert response.status_code == 200
@@ -919,8 +919,8 @@ def test_staff_with_permissions_can_edit_customer(
staff_group.permissions.add(permission_view_user)
staff_user.groups.add(staff_group)
staff_user = User.objects.get(pk=staff_user.pk)
- assert staff_user.has_perm("userprofile.edit_user")
- assert staff_user.has_perm("userprofile.view_user")
+ assert staff_user.has_perm("account.edit_user")
+ assert staff_user.has_perm("account.view_user")
response = staff_client.get(reverse('dashboard:customer-update',
args=[customer_user.pk]))
assert response.status_code == 200
@@ -939,8 +939,8 @@ def test_staff_with_permissions_can_add_customer(
staff_group.permissions.add(permission_view_user)
staff_user.groups.add(staff_group)
staff_user = User.objects.get(pk=staff_user.pk)
- assert staff_user.has_perm("userprofile.edit_user")
- assert staff_user.has_perm("userprofile.view_user")
+ assert staff_user.has_perm("account.edit_user")
+ assert staff_user.has_perm("account.view_user")
response = staff_client.get(reverse('dashboard:customer-create'))
assert response.status_code == 200
url = reverse('dashboard:customer-create')
diff --git a/tests/dashboard/test_staff.py b/tests/dashboard/test_staff.py
index afba112ef9..0afeea9d55 100644
--- a/tests/dashboard/test_staff.py
+++ b/tests/dashboard/test_staff.py
@@ -8,7 +8,7 @@ from templated_email import send_templated_mail
from saleor.dashboard.staff.forms import StaffForm
from saleor.settings import DEFAULT_FROM_EMAIL
-from saleor.userprofile.models import User
+from saleor.account.models import User
def test_staff_form_not_valid(db):
diff --git a/tests/test_checkout.py b/tests/test_checkout.py
index f0add06e4e..eb07599b3d 100644
--- a/tests/test_checkout.py
+++ b/tests/test_checkout.py
@@ -10,7 +10,7 @@ from saleor.checkout import views
from saleor.checkout.core import STORAGE_SESSION_KEY, Checkout
from saleor.checkout.forms import NoteForm
from saleor.shipping.models import ShippingMethodCountry
-from saleor.userprofile.models import Address
+from saleor.account.models import Address
def test_checkout_version():
diff --git a/tests/test_checkout_integration.py b/tests/test_checkout_integration.py
index e842793034..d6678e5fe9 100644
--- a/tests/test_checkout_integration.py
+++ b/tests/test_checkout_integration.py
@@ -1,7 +1,7 @@
from django.urls import reverse
from payments import FraudStatus, PaymentStatus
-from saleor.userprofile.models import User
+from saleor.account.models import User
from .utils import get_redirect_location
diff --git a/tests/test_core.py b/tests/test_core.py
index b804e76b9b..f086cce93c 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -10,7 +10,7 @@ from saleor.discount.models import Sale, Voucher
from saleor.order.models import Order
from saleor.product.models import Product
from saleor.shipping.models import ShippingMethod
-from saleor.userprofile.models import Address, User
+from saleor.account.models import Address, User
type_schema = {
'Vegetable': {
diff --git a/tests/test_elasticsearch.py b/tests/test_elasticsearch.py
index 7f97cc0e34..498fd9440c 100644
--- a/tests/test_elasticsearch.py
+++ b/tests/test_elasticsearch.py
@@ -6,7 +6,7 @@ from elasticsearch_dsl.connections import connections
from saleor.order.models import Order
from saleor.product.models import Product
-from saleor.userprofile.models import User
+from saleor.account.models import User
MATCH_SEARCH_REQUEST = ['method', 'host', 'port', 'path']
STOREFRONT_PRODUCTS = {15, 56} # same as in recorded data!
diff --git a/tests/test_impersonation.py b/tests/test_impersonation.py
index 0391ba3671..bb73e35089 100644
--- a/tests/test_impersonation.py
+++ b/tests/test_impersonation.py
@@ -2,7 +2,7 @@ import pytest
from django.urls import reverse
from django.urls.exceptions import NoReverseMatch
-from saleor.userprofile.models import User
+from saleor.account.models import User
def test_staff_with_permission_can_impersonate(
diff --git a/tests/test_postgresql_search.py b/tests/test_postgresql_search.py
index be4a8ea53e..00fc65caa9 100644
--- a/tests/test_postgresql_search.py
+++ b/tests/test_postgresql_search.py
@@ -5,7 +5,7 @@ from django.urls import reverse
from saleor.order.models import Order
from saleor.product.models import Product
-from saleor.userprofile.models import Address, User
+from saleor.account.models import Address, User
@pytest.fixture(scope='function', autouse=True)
@@ -227,7 +227,7 @@ def test_find_user_by_name(admin_client, users_with_addresses, phrase,
USER_PHRASE_WITH_RESULT = '[email protected]'
-USER_RESULTS_PERMISSION = 'userprofile.view_user'
+USER_RESULTS_PERMISSION = 'account.view_user'
@pytest.mark.integration
diff --git a/tests/test_userprofile.py b/tests/test_userprofile.py
index cba400d3b2..1d11f12158 100644
--- a/tests/test_userprofile.py
+++ b/tests/test_userprofile.py
@@ -9,9 +9,9 @@ from django.template import Context, Template
from django.urls import reverse
from django_countries.fields import Country
-from saleor.userprofile import forms, i18n
-from saleor.userprofile.templatetags.i18n_address_tags import format_address
-from saleor.userprofile.validators import validate_possible_number
+from saleor.account import forms, i18n
+from saleor.account.templatetags.i18n_address_tags import format_address
+from saleor.account.validators import validate_possible_number
@pytest.mark.parametrize('country', ['CN', 'PL', 'US'])