Skip to content

Commit 082ae9c

Browse files
committed
Simplier Blueprint deletion check
Do not check if the blueprint artifacts are installed. Simply check that the blueprint contains no blueprint artifact. The ORM query is not optimized.
1 parent 8a0141d commit 082ae9c

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

zentral/contrib/mdm/models.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -372,16 +372,8 @@ class BlueprintManager(models.Manager):
372372
def can_be_deleted(self):
373373
return self.annotate(
374374
bpa_count=Count("blueprintartifact"),
375-
da_count=Count("blueprintartifact__artifact__artifactversion__deviceartifact"),
376-
ua_count=Count("blueprintartifact__artifact__artifactversion__userartifact"),
377-
dc_count=Count("blueprintartifact__artifact__artifactversion__devicecommand"),
378-
uc_count=Count("blueprintartifact__artifact__artifactversion__usercommand"),
379375
).filter(
380376
bpa_count=0,
381-
da_count=0,
382-
ua_count=0,
383-
dc_count=0,
384-
uc_count=0,
385377
)
386378

387379

0 commit comments

Comments
 (0)