update all
This commit is contained in:
@@ -12,7 +12,7 @@ class YandexAuthView(BaseView):
|
||||
def get(self):
|
||||
code = self.request.GET['code']
|
||||
response = post('https://oauth.yandex.ru/token', data={
|
||||
'client_id': '2c5235f2ce5b4665856d15f70aa876f2',
|
||||
'client_id': '38f1906e99de4810bd79828f420ba885',
|
||||
'client_secret': settings.YANDEX_SERVICE_TOKEN,
|
||||
'grant_type': 'authorization_code',
|
||||
'code': code
|
||||
@@ -33,11 +33,11 @@ class YandexAuthView(BaseView):
|
||||
data = info_response.json()
|
||||
yandex_id = data['id']
|
||||
if self.request.user.is_authenticated:
|
||||
print('Got yandex_id %s writing to db' + str(yandex_id) + " " + type(yandex_id))
|
||||
print('Got yandex_id writing to db ' + str(yandex_id))
|
||||
self.request.user.yandex_id = yandex_id
|
||||
self.request.user.save()
|
||||
else:
|
||||
print('Got yandex_id %s logging in' + str(yandex_id) + " " + type(yandex_id))
|
||||
print('Got yandex_id logging in' + str(yandex_id))
|
||||
user = CustomUser.objects.filter(yandex_id=yandex_id).first()
|
||||
if user is not None:
|
||||
login(self.request, user)
|
||||
|
Reference in New Issue
Block a user