Skip to content

Commit 3047298

Browse files
committed
delete conf file if protected layers were removed
1 parent b5d49ff commit 3047298

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Mergin/utils_auth.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,8 @@ def export_auth(self, client) -> None:
622622

623623
auth_ids = self.get_layers_auth_ids()
624624
if not auth_ids:
625+
if os.path.exists(self.auth_file):
626+
os.remove(self.auth_file)
625627
return
626628

627629
if not client.has_writing_permissions(self.mp.project_full_name()):
@@ -657,9 +659,9 @@ def export_auth(self, client) -> None:
657659
# Export and inject hash
658660
temp_file = os.path.join(self.project_path, f"temp_{AUTH_CONFIG_FILENAME}")
659661

660-
success = self.auth_mngr.exportAuthenticationConfigsToXml(temp_file, list(auth_ids), self.project_id)
662+
ok = self.auth_mngr.exportAuthenticationConfigsToXml(temp_file, list(auth_ids), self.project_id)
661663

662-
if success:
664+
if ok:
663665
with open(temp_file, "r", encoding="utf-8") as f:
664666
xml_content = f.read()
665667

0 commit comments

Comments
 (0)