mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-20 11:29:25 +02:00
Cleanup js
This commit is contained in:
parent
5a05512944
commit
32135ef4b9
3 changed files with 1 additions and 8 deletions
|
@ -23,7 +23,6 @@ class OpenIdConnectBackend(ModelBackend):
|
|||
def authenticate(self, request, **kwargs):
|
||||
logger.debug("kwargs %s" % kwargs)
|
||||
user = None
|
||||
|
||||
if not kwargs or "sub" not in kwargs.keys():
|
||||
return user
|
||||
|
||||
|
|
|
@ -113,12 +113,10 @@ def login_callback(request):
|
|||
user.save()
|
||||
|
||||
login(request, user)
|
||||
|
||||
logger.info("Successfully logged in user %s" % user)
|
||||
|
||||
# Clear the flag if the exception is not caught
|
||||
request.session.pop("redirect_attempted", None)
|
||||
|
||||
return redirect(request.session.get("next", "/"))
|
||||
else:
|
||||
raise o_e.BannedUser()
|
||||
|
|
|
@ -920,11 +920,9 @@ function hideDeletedForms() {
|
|||
|
||||
function showInputOnErrorFields(){
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let form = document.querySelector("#finish-profile-setup-form");
|
||||
console.log(`form: ${form}`)
|
||||
// Get all input elements within the form
|
||||
let form = document.querySelector("#finish-profile-setup-form");
|
||||
let inputs = form ? form.querySelectorAll("input") : null;
|
||||
console.log(`look: ${inputs}`)
|
||||
if (!inputs) {
|
||||
return null;
|
||||
}
|
||||
|
@ -933,13 +931,11 @@ function hideDeletedForms() {
|
|||
inputs.forEach(function(input) {
|
||||
let fieldName = input.name;
|
||||
let errorMessage = document.querySelector(`#id_${fieldName}__error-message`);
|
||||
console.log(`fieldName: ${inputs} vs err message ${errorMessage}`)
|
||||
if (!fieldName || !errorMessage) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let editButton = document.querySelector(`#${fieldName}__edit-button`);
|
||||
console.log(`edit button is ${editButton} vs id #${fieldName}__edit-button`)
|
||||
if (editButton){
|
||||
// Show the input field of the field that errored out
|
||||
editButton.click();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue