# HG changeset patch # User neko259 # Date 2016-05-10 17:30:26 # Node ID 72507874f17e3aeea0a7b744851b374ac41c73a0 # Parent dd8d22d4c668208e87fb00796f27dbd05c79d5ab Invalidate signatures along with global ID content diff --git a/boards/management/commands/invalidate_sync_cache.py b/boards/management/commands/invalidate_sync_cache.py --- a/boards/management/commands/invalidate_sync_cache.py +++ b/boards/management/commands/invalidate_sync_cache.py @@ -12,9 +12,11 @@ class Command(BaseCommand): @transaction.atomic def handle(self, *args, **options): count = 0 - for global_id in GlobalId.objects.all(): + for global_id in GlobalId.objects.exclude(content__isnull=True).exclude( + content=''): if global_id.is_local() and global_id.content is not None: global_id.content = None global_id.save() + global_id.signature_set.all().delete() count += 1 print('Invalidated {} caches.'.format(count))