Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
b311cc7c
Commit
b311cc7c
authored
Jul 13, 2023
by
John Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: already active when re-invite member
parent
074faa4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
members.py
api/controllers/console/workspace/members.py
+1
-1
account_service.py
api/services/account_service.py
+6
-2
No files found.
api/controllers/console/workspace/members.py
View file @
b311cc7c
...
@@ -98,7 +98,7 @@ class MemberCancelInviteApi(Resource):
...
@@ -98,7 +98,7 @@ class MemberCancelInviteApi(Resource):
@
login_required
@
login_required
@
account_initialization_required
@
account_initialization_required
def
delete
(
self
,
member_id
):
def
delete
(
self
,
member_id
):
member
=
Account
.
query
.
get
(
str
(
member_id
)
)
member
=
db
.
session
.
query
(
Account
)
.
filter
(
Account
.
id
==
member_id
)
.
first
(
)
if
not
member
:
if
not
member
:
abort
(
404
)
abort
(
404
)
...
...
api/services/account_service.py
View file @
b311cc7c
...
@@ -293,8 +293,6 @@ class TenantService:
...
@@ -293,8 +293,6 @@ class TenantService:
@
staticmethod
@
staticmethod
def
remove_member_from_tenant
(
tenant
:
Tenant
,
account
:
Account
,
operator
:
Account
)
->
None
:
def
remove_member_from_tenant
(
tenant
:
Tenant
,
account
:
Account
,
operator
:
Account
)
->
None
:
"""Remove member from tenant"""
"""Remove member from tenant"""
# todo: check permission
if
operator
.
id
==
account
.
id
and
TenantService
.
check_member_permission
(
tenant
,
operator
,
account
,
'remove'
):
if
operator
.
id
==
account
.
id
and
TenantService
.
check_member_permission
(
tenant
,
operator
,
account
,
'remove'
):
raise
CannotOperateSelfError
(
"Cannot operate self."
)
raise
CannotOperateSelfError
(
"Cannot operate self."
)
...
@@ -303,6 +301,12 @@ class TenantService:
...
@@ -303,6 +301,12 @@ class TenantService:
raise
MemberNotInTenantError
(
"Member not in tenant."
)
raise
MemberNotInTenantError
(
"Member not in tenant."
)
db
.
session
.
delete
(
ta
)
db
.
session
.
delete
(
ta
)
account
.
initialized_at
=
None
account
.
status
=
AccountStatus
.
PENDING
.
value
account
.
password
=
None
account
.
password_salt
=
None
db
.
session
.
commit
()
db
.
session
.
commit
()
@
staticmethod
@
staticmethod
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment