mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-20 03:19:24 +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):
|
def authenticate(self, request, **kwargs):
|
||||||
logger.debug("kwargs %s" % kwargs)
|
logger.debug("kwargs %s" % kwargs)
|
||||||
user = None
|
user = None
|
||||||
|
|
||||||
if not kwargs or "sub" not in kwargs.keys():
|
if not kwargs or "sub" not in kwargs.keys():
|
||||||
return user
|
return user
|
||||||
|
|
||||||
|
|
|
@ -113,12 +113,10 @@ def login_callback(request):
|
||||||
user.save()
|
user.save()
|
||||||
|
|
||||||
login(request, user)
|
login(request, user)
|
||||||
|
|
||||||
logger.info("Successfully logged in user %s" % user)
|
logger.info("Successfully logged in user %s" % user)
|
||||||
|
|
||||||
# Clear the flag if the exception is not caught
|
# Clear the flag if the exception is not caught
|
||||||
request.session.pop("redirect_attempted", None)
|
request.session.pop("redirect_attempted", None)
|
||||||
|
|
||||||
return redirect(request.session.get("next", "/"))
|
return redirect(request.session.get("next", "/"))
|
||||||
else:
|
else:
|
||||||
raise o_e.BannedUser()
|
raise o_e.BannedUser()
|
||||||
|
|
|
@ -920,11 +920,9 @@ function hideDeletedForms() {
|
||||||
|
|
||||||
function showInputOnErrorFields(){
|
function showInputOnErrorFields(){
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
let form = document.querySelector("#finish-profile-setup-form");
|
|
||||||
console.log(`form: ${form}`)
|
|
||||||
// Get all input elements within the form
|
// Get all input elements within the form
|
||||||
|
let form = document.querySelector("#finish-profile-setup-form");
|
||||||
let inputs = form ? form.querySelectorAll("input") : null;
|
let inputs = form ? form.querySelectorAll("input") : null;
|
||||||
console.log(`look: ${inputs}`)
|
|
||||||
if (!inputs) {
|
if (!inputs) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -933,13 +931,11 @@ function hideDeletedForms() {
|
||||||
inputs.forEach(function(input) {
|
inputs.forEach(function(input) {
|
||||||
let fieldName = input.name;
|
let fieldName = input.name;
|
||||||
let errorMessage = document.querySelector(`#id_${fieldName}__error-message`);
|
let errorMessage = document.querySelector(`#id_${fieldName}__error-message`);
|
||||||
console.log(`fieldName: ${inputs} vs err message ${errorMessage}`)
|
|
||||||
if (!fieldName || !errorMessage) {
|
if (!fieldName || !errorMessage) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let editButton = document.querySelector(`#${fieldName}__edit-button`);
|
let editButton = document.querySelector(`#${fieldName}__edit-button`);
|
||||||
console.log(`edit button is ${editButton} vs id #${fieldName}__edit-button`)
|
|
||||||
if (editButton){
|
if (editButton){
|
||||||
// Show the input field of the field that errored out
|
// Show the input field of the field that errored out
|
||||||
editButton.click();
|
editButton.click();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue