mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-10-31 16:07:38 +03:00 
			
		
		
		
	Fix missing six.text_type() call on APIException.__str__ (#5476)
Pull up method from subclass to superclass
The call was added in 426547c61c
to allow for dict-style arguments to ValidationError but does not
apply to other APIException descendants.
			
			
This commit is contained in:
		
							parent
							
								
									5dcb460793
								
							
						
					
					
						commit
						cc7f4f543f
					
				|  | @ -92,7 +92,7 @@ class APIException(Exception): | ||||||
|         self.detail = _get_error_details(detail, code) |         self.detail = _get_error_details(detail, code) | ||||||
| 
 | 
 | ||||||
|     def __str__(self): |     def __str__(self): | ||||||
|         return self.detail |         return six.text_type(self.detail) | ||||||
| 
 | 
 | ||||||
|     def get_codes(self): |     def get_codes(self): | ||||||
|         """ |         """ | ||||||
|  | @ -136,9 +136,6 @@ class ValidationError(APIException): | ||||||
| 
 | 
 | ||||||
|         self.detail = _get_error_details(detail, code) |         self.detail = _get_error_details(detail, code) | ||||||
| 
 | 
 | ||||||
|     def __str__(self): |  | ||||||
|         return six.text_type(self.detail) |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| class ParseError(APIException): | class ParseError(APIException): | ||||||
|     status_code = status.HTTP_400_BAD_REQUEST |     status_code = status.HTTP_400_BAD_REQUEST | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user