Prevent locked drawings to be deleted. Fixes https://github.com/GNS3/gns3-gui/issues/2948

pull/1731/head
grossmj 4 years ago
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…
Cancel
Save