fix(sunset): release candidate

This commit is contained in:
SabreCat
2023-08-07 15:04:44 -05:00
parent a8b52ab656
commit 9fa355fbcc
6 changed files with 22 additions and 9 deletions

View File

@@ -41,6 +41,9 @@ export async function createChallenge (user, req, res) {
});
if (!group) throw new NotFound(res.t('groupNotFound'));
if (!group.isMember(user)) throw new NotAuthorized(res.t('mustBeGroupMember'));
if (group.type === 'guild' && group._id !== TAVERN_ID && !group.hasActiveGroupPlan()) {
throw new BadRequest(res.t('featureRetired'));
}
if (group.leaderOnly && group.leaderOnly.challenges && group.leader !== user._id) {
throw new NotAuthorized(res.t('onlyGroupLeaderChal'));