mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-11 16:41:04 +00:00
Fix Error when cleaning image behind us #665
This commit is contained in:
parent
be0fee99e7
commit
43afce740d
@ -171,7 +171,9 @@ class Drawing:
|
|||||||
# Update node properties with additional elements
|
# Update node properties with additional elements
|
||||||
svg_changed = False
|
svg_changed = False
|
||||||
for prop in kwargs:
|
for prop in kwargs:
|
||||||
if getattr(self, prop) != kwargs[prop]:
|
if prop == "drawing_id":
|
||||||
|
pass # No good reason to change a drawing_id
|
||||||
|
elif getattr(self, prop) != kwargs[prop]:
|
||||||
if prop == "svg":
|
if prop == "svg":
|
||||||
# To avoid spamming client with large data we don't send the svg if the SVG didn't change
|
# To avoid spamming client with large data we don't send the svg if the SVG didn't change
|
||||||
svg_changed = True
|
svg_changed = True
|
||||||
|
@ -512,7 +512,10 @@ class Project:
|
|||||||
try:
|
try:
|
||||||
pictures = set(os.listdir(self.pictures_directory))
|
pictures = set(os.listdir(self.pictures_directory))
|
||||||
for drawing in self._drawings.values():
|
for drawing in self._drawings.values():
|
||||||
pictures.remove(drawing.ressource_filename)
|
try:
|
||||||
|
pictures.remove(drawing.ressource_filename)
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
for pict in pictures:
|
for pict in pictures:
|
||||||
os.remove(os.path.join(self.pictures_directory, pict))
|
os.remove(os.path.join(self.pictures_directory, pict))
|
||||||
|
Loading…
Reference in New Issue
Block a user