mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-10-26 05:31:07 +03:00 
			
		
		
		
	Pass non-JSON serializable values through unmodified
This commit is contained in:
		
							parent
							
								
									7a0bd1c4d1
								
							
						
					
					
						commit
						f56b117064
					
				|  | @ -85,7 +85,11 @@ class BoundField(object): | |||
| 
 | ||||
| class JSONBoundField(BoundField): | ||||
|     def as_form_field(self): | ||||
|         value = json.dumps(self.value, sort_keys=True, indent=4) | ||||
|         value = self.value | ||||
|         try: | ||||
|             value = json.dumps(self.value, sort_keys=True, indent=4) | ||||
|         except TypeError: | ||||
|             pass | ||||
|         return self.__class__(self._field, value, self.errors, self._prefix) | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user