From f67b68aaf43ebb3b03cb9935bd4bb33d3f4dcc8f Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 11 Dec 2024 14:38:23 -0500 Subject: [PATCH] glamr/load: Fix missing sync of access columns during data loading. --- mibios/glamr/load.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mibios/glamr/load.py b/mibios/glamr/load.py index 7ea1cff4..c60bb83a 100644 --- a/mibios/glamr/load.py +++ b/mibios/glamr/load.py @@ -209,10 +209,15 @@ def split_by_comma(self, value, obj): ) def load(self, *args, **kwargs): + """ + Load Dataset records from the datasets/studies google sheet + """ # avoid circular import: self.staff_group_name = import_string('mibios.glamr.accounts.STAFF_GROUP_NAME') # noqa:E501 self.skipped = [] super().load(*args, **kwargs) + if connections['default'].vendor == 'postgresql': + self.model.objects.update_access() skipped_ids = [getattr(i, 'dataset_id', None) for i in self.skipped] qs = self.filter(dataset_id__in=skipped_ids) if qs.exists(): @@ -523,6 +528,8 @@ def load_meta(self, **kwargs): for key, field_list in get_sample_blocklist().items() } self.load(**kwargs) + if connections['default'].vendor == 'postgresql': + self.model.objects.update_access() flag = SampleTracking.Flag.METADATA for i in self._saved_samples: tr, new = SampleTracking.objects.get_or_create(sample=i, flag=flag)