From 6f7ccb640907cdd73c0ab6505c0ef88f293fd7a0 Mon Sep 17 00:00:00 2001 From: Mike Johnston Date: Fri, 20 Mar 2026 22:15:03 -0400 Subject: [PATCH] fix already approved org application --- src/routes/hunts.js | 5 ++--- src/views/apply-organizer.ejs | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/routes/hunts.js b/src/routes/hunts.js index 21c04c5..1480fd0 100644 --- a/src/routes/hunts.js +++ b/src/routes/hunts.js @@ -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) => { diff --git a/src/views/apply-organizer.ejs b/src/views/apply-organizer.ejs index 19cbbfe..01921e5 100644 --- a/src/views/apply-organizer.ejs +++ b/src/views/apply-organizer.ejs @@ -8,7 +8,13 @@

If you'd like to run your own hunts, fill out the form below. An admin will review your application.

- <% if (typeof pendingApplication !== 'undefined' && pendingApplication) { %> + <% if (typeof alreadyOrganizer !== 'undefined' && alreadyOrganizer) { %> +
+
✅ You're Already an Organizer!
+

You already have organizer access. Head over to your dashboard to create and manage hunts.

+ Go to Organizer Dashboard +
+ <% } else if (typeof pendingApplication !== 'undefined' && pendingApplication) { %>
⏳ Application Pending

Your application is pending review. Hang tight!