The following error occurs
NoMethodError (undefined method `invite_key' for nil:NilClass)
/var/www/discourse/app/models/invite.rb:82:in `generate_invite_link'
on this line: discourse/invite.rb at master · discourse/discourse · GitHub
It happens when trying to generate a link for a user that has already been invited. Perhaps it should return a 422, as inviting by email does, instead?
I’m trying to call these API endpoints from another application, and would like to differentiate between “already invited” and “server error”. The discourse frontend handles it pretty well though:
Pinging @techAPJ based on involvement in Copy Invite Link 🔗
Thanks for discourse being awesome!