Bug: link from invitation gives a 500

Fixes #569 , @Eslamunto Please review.