fix tenant view temporary password email, display message if user tries to register...
[plstackapi.git] / planetstack / templates / admin / login.html
index a165707..37f1055 100644 (file)
 {% 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 %}
+<p class="errornote">
+    {{ error }}
+</p>
+{% endfor %}
+{% for error in form.this_is_the_login_form.errors %}
 <p class="errornote">
     {{ error }}
 </p>
@@ -126,7 +131,16 @@ $("#request-signup").unbind().click(function(){
                                                                },
                                                                async: false,
                                                                type: 'POST',
-                                                               success: function () {
+                                                               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;
+                                                                        }
+                                                                    }
                                                                        $("#request-account-form").dialog("close");     
                                                                        alert("Your request has been submitted");                                                       
                                                                },