-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create group invite links #834
base: master
Are you sure you want to change the base?
Conversation
73434b9
to
16cb3b1
Compare
@@ -168,7 +168,7 @@ def _generate_token(self, user_fields, scope, expiration, **extra_fields): | |||
return token | |||
|
|||
@staticmethod | |||
def _verify_token(token, fields, scope) -> Optional[Tuple["User", Optional[str]]]: | |||
def _verify_token(token, fields, scope) -> Optional[Tuple["User", dict]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dict
is a generic type (dict[KT, VT]
). Its key and value types should be parametrized.
) | ||
if result is None: | ||
return None | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else
after return
isn't necessary (unless used for performance reasons in an extremely often called function).
token, | ||
["password_ver", "identity_ver"], | ||
scope=AuthScope.session, | ||
) | ||
if result is None: | ||
return None | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else
after return
isn't necessary (unless used for performance reasons in an extremely often called function).
return None if result is None else result[0] | ||
if result is None: | ||
return None | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else
after return
isn't necessary (unless used for performance reasons in an extremely often called function).
raise InternalServerError( | ||
"SMTP server needed to fulfill this request is" | ||
" not configured or unavailable." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good place for exception chaining.
Your checklist for this pull request
What is the current behaviour?
You cannot invite users to your group
What is the new behaviour?
You can invite users to group
After inviting, user receives email with link
Invited user can click the link and join your group
You have to be
group admin
to invite usersLinks expire after 7 days by default, you can configure it
Test plan
I've added automatic tests
Closing issues
closes #824