core: handle error when cleaning up sessions and cached session can't be loaded
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
		@ -50,7 +50,8 @@ class TaskSerializer(PassiveSerializer):
 | 
			
		||||
        are pickled in cache. In that case, just delete the info"""
 | 
			
		||||
        try:
 | 
			
		||||
            return super().to_representation(instance)
 | 
			
		||||
        except AttributeError:  # pragma: no cover
 | 
			
		||||
        # pylint: disable=broad-except
 | 
			
		||||
        except Exception:  # pragma: no cover
 | 
			
		||||
            if isinstance(self.instance, list):
 | 
			
		||||
                for inst in self.instance:
 | 
			
		||||
                    inst.delete()
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user