Skip to content

Commit

Permalink
fix: add account register error message
Browse files Browse the repository at this point in the history
  • Loading branch information
GareArc committed Dec 26, 2024
1 parent f0c30ea commit 04cb7bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/controllers/console/auth/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get(self, provider: str):
"?message=Workspace not found, please contact system admin to invite you to join in a workspace."
)
except AccountRegisterError as e:
return redirect(f"{dify_config.CONSOLE_WEB_URL}/signin?message={str(e)}")
return redirect(f"{dify_config.CONSOLE_WEB_URL}/signin?message={e.description}")

# Check account status
if account.status == AccountStatus.BANNED.value:
Expand Down
4 changes: 4 additions & 0 deletions api/services/account_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,10 @@ def register(
db.session.commit()
except WorkSpaceNotAllowedCreateError:
db.session.rollback()
except AccountRegisterError as are:
db.session.rollback()
logging.exception("Register failed")
raise are
except Exception as e:
db.session.rollback()
logging.exception("Register failed")
Expand Down

0 comments on commit 04cb7bf

Please sign in to comment.