From 481f9a881fee91a73fc832bbe9c743f1e37dd8f1 Mon Sep 17 00:00:00 2001 From: SDE Date: Thu, 25 Jan 2024 18:36:15 +0300 Subject: [PATCH] 0.12.5 google auth fix --- AuthApp/views.py | 6 +++++- templates/forms/f_login.html | 16 ++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/AuthApp/views.py b/AuthApp/views.py index 872eeda..9650529 100644 --- a/AuthApp/views.py +++ b/AuthApp/views.py @@ -117,7 +117,11 @@ def logout_View(request): def login_View(request): - Dict = {} + from allauth.socialaccount.models import SocialApp + auth_google_allow = SocialApp.objects.filter(provider='google') + Dict = { + 'auth_google_allow': auth_google_allow + } t = loader.get_template('pages/profile/p_login.html') return get_inter_http_respose(t, Dict, request) diff --git a/templates/forms/f_login.html b/templates/forms/f_login.html index 81368bb..c55af35 100644 --- a/templates/forms/f_login.html +++ b/templates/forms/f_login.html @@ -30,13 +30,17 @@
{% translate "Авторизуясь, вы соглашаетесь с Лицензионным соглашением Политикой конфиденциальности" %}
-
{% translate "Или" %}
+ + {% if auth_google_allow %} +
{% translate "Или" %}
- -
-
{% translate "Войти через" %} Google
-
-
+ + +
+
{% translate "Войти через" %} Google
+
+
+ {% endif %}
{% translate "Нет аккаунта?" %} {% translate "Зарегистрируйтесь" %}