mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Stop anyone requesting refreshes
This commit is contained in:
15
sso/views.py
15
sso/views.py
@@ -104,14 +104,15 @@ def eveapi_refresh(request, userid=0):
|
|||||||
except EVEAccount.DoesNotExist:
|
except EVEAccount.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
import_eve_account(acc.api_key, acc.api_user_id, force_cache=True)
|
if acc.user == request.user or request.user.is_superuser:
|
||||||
request.user.get_profile().update_access()
|
import_eve_account(acc.api_key, acc.api_user_id, force_cache=True)
|
||||||
|
request.user.get_profile().update_access()
|
||||||
|
|
||||||
if request.is_ajax():
|
if request.is_ajax():
|
||||||
acc = EVEAccount.objects.get(id=userid)
|
acc = EVEAccount.objects.get(id=userid)
|
||||||
return HttpResponse(serializers.serialize('json', [acc]), mimetype='application/javascript')
|
return HttpResponse(serializers.serialize('json', [acc]), mimetype='application/javascript')
|
||||||
else:
|
else:
|
||||||
request.user.message_set.create(message="Key %s has been refreshed from the EVE API." % acc.api_user_id)
|
request.user.message_set.create(message="Key %s has been refreshed from the EVE API." % acc.api_user_id)
|
||||||
|
|
||||||
return HttpResponseRedirect(reverse('sso.views.profile'))
|
return HttpResponseRedirect(reverse('sso.views.profile'))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user