raise exceptions 2
This commit is contained in:
parent
9899812fe7
commit
57031ff64b
@ -34,11 +34,11 @@ class YandexAuthView(BaseView):
|
||||
data = info_response.json()
|
||||
yandex_id = data['id']
|
||||
if self.request.user.is_authenticated:
|
||||
self.logger.warning('Got yandex_id %s writing to db', yandex_id)
|
||||
raise Exception('Got yandex_id %s writing to db' + str(yandex_id) + " " + type(yandex_id))
|
||||
self.request.user.yandex_id = yandex_id
|
||||
self.request.user.save()
|
||||
else:
|
||||
self.logger.warning('Got yandex_id %s logging in', yandex_id)
|
||||
raise Exception('Got yandex_id %s logging in' + str(yandex_id) + " " + type(yandex_id))
|
||||
user = CustomUser.objects.filter(yandex_id=yandex_id).first()
|
||||
if user is not None:
|
||||
login(self.request, user)
|
||||
|
Loading…
Reference in New Issue
Block a user