mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-24 15:58:08 +00:00
Prevent locked drawings to be deleted. Fixes https://github.com/GNS3/gns3-gui/issues/2948
This commit is contained in:
parent
868c39acfe
commit
615cffd9ac
@ -16,7 +16,6 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import hashlib
|
||||
import asyncio
|
||||
import base64
|
||||
import uuid
|
||||
import re
|
||||
|
@ -684,6 +684,8 @@ class Project:
|
||||
@open_required
|
||||
async def delete_drawing(self, drawing_id):
|
||||
drawing = self.get_drawing(drawing_id)
|
||||
if drawing.locked:
|
||||
raise aiohttp.web.HTTPConflict(text="Drawing ID {} cannot be deleted because it is locked".format(drawing_id))
|
||||
del self._drawings[drawing.id]
|
||||
self.dump()
|
||||
self.emit_notification("drawing.deleted", drawing.__json__())
|
||||
|
Loading…
Reference in New Issue
Block a user