Created by: kopancek
🐛 Fixed problem when member could not access the organization if there was an expired invitation in the DB
🐛 Fixed problem when username based invitation was stored with an email in the DB instead
🐛 Fixed problem when username invitation cannot be created if there is a previous expired invitation for the user
Phew! 😫
Tested locally, added unit test coverage as well