mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.7.x] Fixed #23615 -- Validate that a Model instance's "check" attribute is a method.
The "check" name is a reserved word used by Django's check framework,
and cannot be redefined as something else other than a method, or the check
framework will raise an error.
This change amends the django.core.checks.model_check.check_all_models()
function, so that it verifies that a model instance's attribute "check"
is actually a method. This new check is assigned the id "models.E020".
Conflicts:
	docs/ref/checks.txt
Backport of a5c77417a6 from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Loic Bistuer
						Loic Bistuer
					
				
			
			
				
	
			
			
			
						parent
						
							b729ef0bda
						
					
				
				
					commit
					e8262b5941
				
			| @@ -56,6 +56,7 @@ Models | ||||
| * **models.E015**: ``ordering`` refers to the non-existent field | ||||
|   ``<field name>``. | ||||
| * **models.E017**: Proxy model ``<model>`` contains model fields. | ||||
| * **models.E020**: The ``<model>.check()`` class method is currently overridden. | ||||
|  | ||||
| Fields | ||||
| ~~~~~~ | ||||
|   | ||||
| @@ -119,3 +119,6 @@ Bugfixes | ||||
|  | ||||
| * Fixed a crash while parsing cookies containing invalid content | ||||
|   (:ticket:`23638`). | ||||
|  | ||||
| * The system check framework now raises error **models.E020** when the | ||||
|   class method ``Model.check()`` is unreachable (:ticket:`23615`). | ||||
|   | ||||
		Reference in New Issue
	
	Block a user