feat: Add user deletion capability for admins, add WhiteNoise for Django admin static assets, and configure CSRF_TRUSTED_ORIGINS for production reverse proxies

This commit is contained in:
Richard
2026-07-31 11:22:25 +02:00
parent 5f2061f013
commit 2403f1313f
165 changed files with 34871 additions and 40 deletions
@@ -0,0 +1,16 @@
'use strict';
{
const inputTags = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
const modelName = document.getElementById('django-admin-form-add-constants').dataset.modelName;
if (modelName) {
const form = document.getElementById(modelName + '_form');
for (const element of form.elements) {
// HTMLElement.offsetParent returns null when the element is not
// rendered.
if (inputTags.includes(element.tagName) && !element.disabled && element.offsetParent) {
element.focus();
break;
}
}
}
}