Added "Update from Blender ID" button

Added this button in the /u/ user/embed view, so that admins can easily force a re-check from Blender ID without requiring the user themselves to perform any actions.
This commit is contained in:
2017-12-05 11:45:42 +01:00
parent c8221ea0e4
commit 87fe1887e8
4 changed files with 97 additions and 10 deletions

View File

@@ -72,6 +72,7 @@
| none
| {% endif %}
a.btn.btn-default(href="javascript:update_from_bid()") Update from Blender ID
a.btn.btn-default(href="javascript:$('#user-edit-container').html('')") Cancel
input#submit_edit_user.btn.btn-default(
@@ -103,4 +104,16 @@ script(type="text/javascript").
new Clipboard('.copy-to-clipboard');
function update_from_bid() {
var url = '{{ url_for("blender_cloud.subscription.update_subscription_for", user_id=user.user_id) }}';
$.post(url)
.done(function(data) {
toastr.info('User updated from Blender ID');
displayUser('{{ user.user_id }}');
})
.fail(function(data) {
toastr.error(data.responseText);
});
}
| {% endblock %}