Update dashboard.py

- Accepted proposed enhancement on #533
This commit is contained in:
Donald Zou 2024-11-29 14:42:13 +08:00
parent 28716924c9
commit f994e7bfa8

View File

@ -2008,7 +2008,10 @@ def API_sharePeer_create():
return ResponseObject(False, "Please specify configuration and peers")
activeLink = AllPeerShareLinks.getLink(Configuration, Peer)
if len(activeLink) > 0:
return ResponseObject(False, "This peer is already sharing, please stop sharing first.")
return ResponseObject(True,
"This peer is already sharing. Please view data for shared link.",
data=activeLink[0]
)
status, message = AllPeerShareLinks.addLink(Configuration, Peer, ExpireDate)
if not status:
return ResponseObject(status, message)