Start from: Avoid add to templates if already present

This commit is contained in:
Francesco Bellini 2024-09-23 00:31:40 +02:00
parent 7636f7611b
commit 06bf637da9

View File

@ -312,7 +312,7 @@ class CT_OT_start_from(Operator):
def execute(self, context):
prefs = pref()
if self.filepath:
if self.add:
if self.add and not already_present(self, prefs, self.filepath):
template = prefs.projects.add()
template.name = self.name if self.name else name_from_path(self.filepath)
template.path = self.filepath