-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Improve invite users to organization feature #7138
Conversation
cvat-ui/src/components/invitation-watcher/invitation-watcher.tsx
Outdated
Show resolved
Hide resolved
@@ -300,7 +309,7 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP | |||
loadAuthActions(); | |||
} | |||
|
|||
if (user == null || !user.isVerified) { | |||
if (user == null || !user.isVerified || !user.id) { |
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.
How can we have a user without id?
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.
When user is registered (if email verification is disabled), we get user data from response of /register
, and /self
request is not sent. There is no id
in such data
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.
Probably we should fix /register
endpoint instead
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.
Client part LGTM
Please, fix eslint issues:
/home/runner/work/cvat/cvat/cvat-ui/src/components/invitations-page/invitations-list.tsx
Error: 5:30 error 'useEffect' is defined but never used @typescript-eslint/no-unused-vars
Error: 13:8 error 'notification' is defined but never used @typescript-eslint/no-unused-vars
I can still see |
It looks we have a couple of unstable e2e tests right now: They failed in this pr a couple of times(after rerun everything is ok) I will merge this PR as its already approved, and invistigate test problems separately. |
Motivation and context
This PR improves workflow with invitations to organizations. It allows to view, accept, decline invitations to organizations (previously all the invitations were auto-accepted).
It fixes problems with inviting unregistered users to organization allowing them to register without invitation.
How has this been tested?
The best way to test this PR is to add those lines to
cvat/settings/base.py
:Enable email verification:
Setup console email backend
And edit
ORG_INVITATION_CONFIRM
toYes
Checklist
develop
branch(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.