diff --git a/SocialHelper/SocialHelper/__pycache__/settings.cpython-37.pyc b/SocialHelper/SocialHelper/__pycache__/settings.cpython-37.pyc index e2a7a8e..4584a4d 100644 Binary files a/SocialHelper/SocialHelper/__pycache__/settings.cpython-37.pyc and b/SocialHelper/SocialHelper/__pycache__/settings.cpython-37.pyc differ diff --git a/SocialHelper/SocialHelper/settings.py b/SocialHelper/SocialHelper/settings.py index 702d0f7..baa6bc0 100644 --- a/SocialHelper/SocialHelper/settings.py +++ b/SocialHelper/SocialHelper/settings.py @@ -33,6 +33,7 @@ ALLOWED_HOSTS = [] INSTALLED_APPS = [ 'homepage.apps.HomepageConfig', 'enGB.apps.EngbConfig', + 'django.contrib.postgres', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/SocialHelper/enGB/__pycache__/urls.cpython-37.pyc b/SocialHelper/enGB/__pycache__/urls.cpython-37.pyc index c48944a..f62dbac 100644 Binary files a/SocialHelper/enGB/__pycache__/urls.cpython-37.pyc and b/SocialHelper/enGB/__pycache__/urls.cpython-37.pyc differ diff --git a/SocialHelper/enGB/__pycache__/views.cpython-37.pyc b/SocialHelper/enGB/__pycache__/views.cpython-37.pyc index 97f424e..82b5a63 100644 Binary files a/SocialHelper/enGB/__pycache__/views.cpython-37.pyc and b/SocialHelper/enGB/__pycache__/views.cpython-37.pyc differ diff --git a/SocialHelper/enGB/templates/enGB/add_comment.html b/SocialHelper/enGB/templates/enGB/add_comment.html index 27677d6..f9137c2 100644 --- a/SocialHelper/enGB/templates/enGB/add_comment.html +++ b/SocialHelper/enGB/templates/enGB/add_comment.html @@ -17,7 +17,7 @@ -
+ {% csrf_token %} {{ form.media }} {{ form.as_p }} diff --git a/SocialHelper/enGB/templates/enGB/add_offer.html b/SocialHelper/enGB/templates/enGB/add_offer.html index 5ccb5f4..b5596e0 100644 --- a/SocialHelper/enGB/templates/enGB/add_offer.html +++ b/SocialHelper/enGB/templates/enGB/add_offer.html @@ -18,7 +18,7 @@ - + {% csrf_token %} {{ form.media }} {{ form.as_p }} diff --git a/SocialHelper/enGB/templates/enGB/create_user.html b/SocialHelper/enGB/templates/enGB/create_user.html index b7a7a96..9e4b7b3 100644 --- a/SocialHelper/enGB/templates/enGB/create_user.html +++ b/SocialHelper/enGB/templates/enGB/create_user.html @@ -102,7 +102,7 @@ body {font-family: Arial, Helvetica, sans-serif;} - + {% csrf_token %} {{ form.media }} {{ form.as_p }} diff --git a/SocialHelper/enGB/templates/enGB/edit_user.html b/SocialHelper/enGB/templates/enGB/edit_user.html index acc8a9c..3d3be4a 100644 --- a/SocialHelper/enGB/templates/enGB/edit_user.html +++ b/SocialHelper/enGB/templates/enGB/edit_user.html @@ -16,7 +16,7 @@ - + {% csrf_token %} {{ form.media }} {{ form.as_p }} diff --git a/SocialHelper/enGB/templates/enGB/edycja_ogloszenia.html b/SocialHelper/enGB/templates/enGB/edycja_ogloszenia.html index 54c4929..a3e85c1 100644 --- a/SocialHelper/enGB/templates/enGB/edycja_ogloszenia.html +++ b/SocialHelper/enGB/templates/enGB/edycja_ogloszenia.html @@ -16,7 +16,7 @@ - + {% csrf_token %} {{ form.media }} {{ form.as_p }} diff --git a/SocialHelper/enGB/templates/enGB/index.html b/SocialHelper/enGB/templates/enGB/index.html index 8f2c1e6..5002754 100644 --- a/SocialHelper/enGB/templates/enGB/index.html +++ b/SocialHelper/enGB/templates/enGB/index.html @@ -85,7 +85,7 @@ - + {% csrf_token %} diff --git a/SocialHelper/enGB/templates/enGB/my_offer.html b/SocialHelper/enGB/templates/enGB/my_offer.html index 94100bd..e403f12 100644 --- a/SocialHelper/enGB/templates/enGB/my_offer.html +++ b/SocialHelper/enGB/templates/enGB/my_offer.html @@ -67,7 +67,7 @@ - + {% csrf_token %} diff --git a/SocialHelper/enGB/templates/enGB/user_profile.html b/SocialHelper/enGB/templates/enGB/user_profile.html index 19e26e9..235db81 100644 --- a/SocialHelper/enGB/templates/enGB/user_profile.html +++ b/SocialHelper/enGB/templates/enGB/user_profile.html @@ -80,7 +80,7 @@ - + {% csrf_token %} @@ -113,7 +113,7 @@ - + {% csrf_token %} diff --git a/SocialHelper/enGB/templates/ennavbar.html b/SocialHelper/enGB/templates/ennavbar.html index 7f11164..e820520 100644 --- a/SocialHelper/enGB/templates/ennavbar.html +++ b/SocialHelper/enGB/templates/ennavbar.html @@ -15,7 +15,7 @@ diff --git a/SocialHelper/homepage/views.py b/SocialHelper/homepage/views.py index 854a730..c3083d1 100644 --- a/SocialHelper/homepage/views.py +++ b/SocialHelper/homepage/views.py @@ -128,7 +128,7 @@ def filter(request): if place_local != "": - all_product = all_product.filter(place=place_local) + all_product = all_product.filter(place__unaccent__icontains=place_local) if oddam_local == "on" and potrzebuje_local != "on": zmienna = 2 @@ -434,7 +434,10 @@ def logout_user(request): def user_profile(request, user_name): User = get_user_model() - user_prof = User.objects.filter(username=user_name).first() + if User.objects.filter(username=user_name).exists(): + user_prof = User.objects.filter(username=user_name).first() + else: + user_prof = User.objects.filter(email=user_name).first() all_product = Product.objects.filter(active = True, user_iden = user_prof.id) oceny = Ocena.objects.filter(user_iden = user_prof.id)