Commit 3bc219fa authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

astakos: Renew token action from api access view

parent 66240201
......@@ -408,14 +408,22 @@ $('#members-table tr .check input').click(function(e){
/* end of project members page js */
$('.renew-token a.confirm').click(function(e){
e.preventDefault();
e.stopPropagation();
renewToken();
});
$('.renew-token a.do').click(function(e){
e.preventDefault();
e.stopPropagation();
var els = [$(".renew-token .sub"),$('.renew-token .confirm'), $('.renew-token .close')];
_.each(els, function (el) { el.css({'visibility':'visible'});})
})
$('.renew-token a.close').click(function(e){
e.preventDefault();
e.stopPropagation();
var els = [$(".renew-token .sub"),$('.renew-token .confirm'), $('.renew-token .close')];
_.each(els, function (el) { el.css({'visibility':'hidden'});})
})
......
{% extends "im/account_base.html" %}
{% load filters %}
{% block headjs %}
{{ block.super }}
<script>
var CHANGE_TOKEN_URL = '{% url update_token %}';
</script>
{% endblock %}
{% block page.body %}
<form>{% csrf_token %}</form>
<div class="api-access-view">
<div class="subsection">
{% block page.body.title %}
......
......@@ -128,7 +128,7 @@ def update_token(request):
user.renew_token()
user.save()
messages.success(request, astakos_messages.TOKEN_UPDATED)
return HttpResponseRedirect(reverse('edit_profile'))
return HttpResponseRedirect(reverse('api_access'))
@require_http_methods(["GET", "POST"])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment