Allow group plans for private guilds only (#12479)
* hide upgrade button for public guilds * prevent group plans for public guilds * fix unit tests * fix integration and unit tests that assumed group plans could be public guilds * more unit tests fixes * more resilient unit test * more resilient unit test
This commit is contained in:
@@ -91,6 +91,10 @@ async function createSubscription (data) {
|
||||
throw new NotAuthorized(shared.i18n.t('onlyGroupLeaderCanManageSubscription'));
|
||||
}
|
||||
|
||||
if (group.privacy !== 'private') {
|
||||
throw new NotAuthorized(shared.i18n.t('onlyPrivateGuildsCanUpgrade'));
|
||||
}
|
||||
|
||||
recipient = group;
|
||||
itemPurchased = 'Group-Subscription';
|
||||
purchaseType = 'group-subscribe';
|
||||
|
||||
Reference in New Issue
Block a user