fix already approved org application
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 29s

This commit is contained in:
2026-03-20 22:15:03 -04:00
parent 5ac00d2ff1
commit 6f7ccb6409
2 changed files with 9 additions and 4 deletions

View File

@@ -161,11 +161,10 @@ router.post('/player/:username/display-name', requireAuth, (req, res) => {
router.get('/apply-organizer', requireAuth, (req, res) => {
const user = Users.findById(req.session.userId);
if (user.is_organizer || user.is_admin) {
req.session.flash = { type: 'info', message: 'You already have organizer access.' };
return res.redirect(`/player/${user.username}`);
return res.render('apply-organizer', { title: 'Organizer Access', pendingApplication: null, alreadyOrganizer: true });
}
const pendingApplication = OrganizerApplications.findByUser(user.id);
res.render('apply-organizer', { title: 'Apply to Become an Organizer', pendingApplication });
res.render('apply-organizer', { title: 'Apply to Become an Organizer', pendingApplication, alreadyOrganizer: false });
});
router.post('/apply-organizer', requireAuth, (req, res) => {

View File

@@ -8,7 +8,13 @@
<p>If you'd like to run your own hunts, fill out the form below. An admin will review your application.</p>
</div>
<% if (typeof pendingApplication !== 'undefined' && pendingApplication) { %>
<% if (typeof alreadyOrganizer !== 'undefined' && alreadyOrganizer) { %>
<div class="card" style="margin-top: 1.5rem;">
<div class="card-header">&#x2705; You're Already an Organizer!</div>
<p style="color: var(--muted); font-size: 0.9rem;">You already have organizer access. Head over to your dashboard to create and manage hunts.</p>
<a href="/admin" class="btn btn-primary" style="margin-top: 0.5rem;">Go to Organizer Dashboard</a>
</div>
<% } else if (typeof pendingApplication !== 'undefined' && pendingApplication) { %>
<div class="card" style="margin-top: 1.5rem;">
<div class="card-header">&#x23F3; Application Pending</div>
<p style="color: var(--muted); font-size: 0.9rem;">Your application is pending review. Hang tight!</p>