Skip to content
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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Create group invite links #834

wants to merge 17 commits into from

Conversation

Repumba
Copy link
Contributor

@Repumba Repumba commented May 29, 2023

Your checklist for this pull request

  • I've read the contributing guideline.
  • I've tested my changes by building and running the project, and testing changed functionality (if applicable)
  • I've added automated tests for my change (if applicable, optional)
  • I've updated documentation to reflect my change (if applicable)

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 users
Links expire after 7 days by default, you can configure it
image

Test plan

I've added automatic tests

Closing issues

closes #824

@Repumba Repumba force-pushed the feature/group-invite-link branch from 73434b9 to 16cb3b1 Compare May 30, 2023 09:10
@Repumba Repumba marked this pull request as ready for review May 31, 2023 10:48
@@ -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]]:
Copy link

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:
Copy link

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:
Copy link

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:
Copy link

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."
)
Copy link

@bswck bswck Nov 23, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow group administrator to invite people to its group via invitation link
3 participants