Do not include the Licence ending in domain invites

So the message reads like "University of Notre Dame has invited
you to join a team on Overleaf" instead of ""University of Notre
Dame licence..."
This commit is contained in:
Alberto Fernández Capel 2018-06-07 15:01:48 +01:00
parent 88d12b43ac
commit d1b1e6c299

View file

@ -41,9 +41,11 @@ module.exports = TeamInvitesHandler =
createDomainInvite: (user, licence, callback) ->
logger.log {licence, email: user.email}, "Creating domain team invite"
inviterName = licence.name.replace(/\s+licence$/i, licence.name)
SubscriptionLocator.getSubscription licence.subscription_id, (error, subscription) ->
return callback(error) if error?
createInvite(subscription, user.email, licence.name, callback)
createInvite(subscription, user.email, inviterName, callback)
acceptInvite: (token, userId, callback) ->
logger.log {userId}, "Accepting invite"