Skip to content

Commit b45a326

Browse files
authored
Merge pull request #861 from MerginMaps/avalable_auth_id_check
Export auth IDs available in the auth DB
2 parents 90530a8 + 9141f26 commit b45a326

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Mergin/projects_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def sync_project(self, project_dir, project_name=None):
449449
if not dlg.is_complete:
450450
# we were cancelled
451451
return
452-
452+
453453
if is_file_changed(pull_changes, AUTH_CONFIG_FILENAME):
454454
AuthSync().import_auth()
455455

Mergin/utils_auth.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,10 @@ def get_auth_config_hash(self, auth_ids: list[str]) -> str:
620620
def export_auth(self, client) -> None:
621621
"""Export auth DB credentials for protected layers if they have changed"""
622622

623-
auth_ids = self.get_layers_auth_ids()
623+
referenced_ids = self.get_layers_auth_ids()
624+
available_ids = self.auth_mngr.configIds()
625+
auth_ids = [aid for aid in referenced_ids if aid in available_ids]
626+
624627
if not auth_ids:
625628
if os.path.exists(self.auth_file):
626629
os.remove(self.auth_file)

0 commit comments

Comments
 (0)