mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	backend: Add None-checks with assertions and if-elses.
This fixes a batch of mypy errors of the following format: 'Item "None" of "Optional[Something]" has no attribute "abc"'
This commit is contained in:
		@@ -60,6 +60,7 @@ class Command(BaseCommand):
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
        fill_to_time = parse_datetime(options["time"])
 | 
			
		||||
        assert fill_to_time is not None
 | 
			
		||||
        if options["utc"]:
 | 
			
		||||
            fill_to_time = fill_to_time.replace(tzinfo=timezone.utc)
 | 
			
		||||
        if fill_to_time.tzinfo is None:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user