Fix admin template URL endpoints and registration toggle parameter mismatch
PROBLEMS RESOLVED:
1. Admin Settings Template URL Error:
- Fixed breadcrumb navigation in admin_settings.html line 14
- Changed from: url_for('main.admin')
- Changed to: url_for('main.admin_panel')
- Matches actual route function name in routes.py
2. Registration Toggle Parameter Mismatch:
- Fixed admin_users.html registration toggle JavaScript (lines 483-527)
- Changed from using 'registration_disabled' parameter
- Changed to using 'registration_enabled' parameter
- Now matches the admin_registration_settings API endpoint format
3. Registration Toggle Logic Fix:
- Updated toggle.checked logic to use registration_enabled directly
- Fixed status text display to show correct enabled/disabled state
- Corrected AJAX request payload to send registration_enabled boolean
TECHNICAL DETAILS:
- Both templates now use consistent parameter naming with the backend API
- Registration toggle in /admin/users now works correctly with database persistence
- Admin settings breadcrumb navigation no longer throws BuildError
- All admin interfaces now properly integrate with SystemSettings model
This resolves both reported issues:
- '/admin/settings give error' - Fixed URL endpoint mismatch
- 'registration settings in /admin/users keep to show as enabled' - Fixed parameter format
Showing
Please
register
or
sign in
to comment