X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=planetstack%2Ftemplates%2Fadmin%2Flogin.html;h=29534db54089f86b704c4f48ee6d1b99076a7c8a;hb=ed260c2012c507198ec2007ffc90aa962e2806ca;hp=ab066dcb0f4401bd2f76a85dead35bd7167f6f92;hpb=6985cd54f4ac4734d5251bca4f4b5e6f3a27666b;p=plstackapi.git
diff --git a/planetstack/templates/admin/login.html b/planetstack/templates/admin/login.html
index ab066dc..29534db 100644
--- a/planetstack/templates/admin/login.html
+++ b/planetstack/templates/admin/login.html
@@ -25,7 +25,12 @@
{% endif %}
{% if form.non_field_errors or form.this_is_the_login_form.errors %}
-{% for error in form.non_field_errors|add:form.this_is_the_login_form.errors %}
+{% for error in form.non_field_errors %}
+
+ {{ error }}
+
+{% endfor %}
+{% for error in form.this_is_the_login_form.errors %}
{{ error }}
@@ -69,24 +74,12 @@
@@ -138,9 +131,21 @@ $("#request-signup").unbind().click(function(){
},
async: false,
type: 'POST',
- success: function () {
- $("#request-account-form").dialog("close");
- alert("Your request has been submitted");
+ success: function (response) {
+ if (response && response.error) {
+ if (response.error == "already_approved") {
+ alert("Your request has already been proccessed and approved. We are sending you another email with a new temporary password");
+ return;
+ } else if (response.error == "already_pending") {
+ alert("Your request is already pending and awaiting approval");
+ return;
+ } else if (response.error == "is_deleted") {
+ alert("Your user record is in a deleted state. Please contact OpenCloud support");
+ return;
+ }
+ }
+ $("#request-account-form").dialog("close");
+ alert("Your request has been submitted");
},
error:function (xhr, textStatus, thrownError){
alert("Error:", textStatus + " " + xhr.responseText);