mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Remove try/except + test
Changes in d064ff5 made try/except unnecessary and the subsequent test failed.
			
			
This commit is contained in:
		 Clemens Rieder
					Clemens Rieder
				
			
				
					committed by
					
						 Trenton H
						Trenton H
					
				
			
			
				
	
			
			
			 Trenton H
						Trenton H
					
				
			
						parent
						
							dee691b72b
						
					
				
				
					commit
					959f80604a
				
			| @@ -92,18 +92,13 @@ class TagMailAction(BaseMailAction): | ||||
|  | ||||
|         # The custom tag should look like "apple:<color>" | ||||
|         if "apple:" in parameter.lower(): | ||||
|             try: | ||||
|                 _, self.color = parameter.split(":") | ||||
|                 self.color = self.color.strip() | ||||
|  | ||||
|                 if not self.color.lower() in APPLE_MAIL_TAG_COLORS.keys(): | ||||
|                     raise MailError("Not a valid AppleMail tag color.") | ||||
|             except Exception as e: | ||||
|                 raise MailError( | ||||
|                     """Could not parse parameters. | ||||
|                     Make sure they look like this: apple:<color> and | ||||
|                     only use allowed colors.""", | ||||
|                 ) from e | ||||
|             _, self.color = parameter.split(":") | ||||
|             self.color = self.color.strip() | ||||
|  | ||||
|             if not self.color.lower() in APPLE_MAIL_TAG_COLORS.keys(): | ||||
|                 raise MailError("Not a valid AppleMail tag color.") | ||||
|  | ||||
|             self.keyword = None | ||||
|  | ||||
|         else: | ||||
|   | ||||
| @@ -682,11 +682,6 @@ class TestMail(DirectoriesMixin, TestCase): | ||||
|             TagMailAction, | ||||
|             "apple:black", | ||||
|         ) | ||||
|         self.assertRaises( | ||||
|             MailError, | ||||
|             TagMailAction, | ||||
|             "applegreen", | ||||
|         ) | ||||
|  | ||||
|     def test_handle_mail_account_tag_applemail(self): | ||||
|         # all mails will be FLAGGED afterwards | ||||
|   | ||||
		Reference in New Issue
	
	Block a user