mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	only values starting with int possible -> only positive values
This commit is contained in:
		@@ -248,8 +248,6 @@ class ReferenceIndexingSerializerMixin():
 | 
				
			|||||||
    for the BigIntegerField
 | 
					    for the BigIntegerField
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    def validate_reference(self, value):
 | 
					    def validate_reference(self, value):
 | 
				
			||||||
        if extract_int(value) < -models.BigIntegerField.MAX_BIGINT:
 | 
					 | 
				
			||||||
            raise serializers.ValidationError('reference is to to small')
 | 
					 | 
				
			||||||
        if extract_int(value) > models.BigIntegerField.MAX_BIGINT:
 | 
					        if extract_int(value) > models.BigIntegerField.MAX_BIGINT:
 | 
				
			||||||
            raise serializers.ValidationError('reference is to to big')
 | 
					            raise serializers.ValidationError('reference is to to big')
 | 
				
			||||||
        return value
 | 
					        return value
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -124,16 +124,6 @@ class PurchaseOrderTest(OrderTest):
 | 
				
			|||||||
            expected_code=400
 | 
					            expected_code=400
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # too small
 | 
					 | 
				
			||||||
        self.post(
 | 
					 | 
				
			||||||
            url,
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                'supplier': 1,
 | 
					 | 
				
			||||||
                'reference': -huge_numer,
 | 
					 | 
				
			||||||
                'description': 'PO not created via the API',
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            expected_code=400
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_po_attachments(self):
 | 
					    def test_po_attachments(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user