File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -95,16 +95,14 @@ def action_sold(self):
9595 raise UserError ("A cancelled property cannot be set as sold" )
9696 record .state = "sold"
9797
98- _sql_constraints = [
99- (
100- "check_expected_price" ,
101- "CHECK(expected_price > 0)" ,
102- "The expected price must be strictly positive." ,
98+ _constraints = [
99+ models .CheckConstraint (
100+ "expected_price > 0" ,
101+ message = "The expected price must be strictly positive." ,
103102 ),
104- (
105- "check_selling_price_positive" ,
106- "CHECK(selling_price >= 0)" ,
107- "The selling price must be positive." ,
103+ models .CheckConstraint (
104+ "selling_price >= 0" ,
105+ message = "The selling price must be positive." ,
108106 ),
109107 ]
110108
@@ -123,4 +121,3 @@ def _check_selling_price_ratio(self):
123121 raise ValidationError (
124122 "The selling price cannot be lower than 90% of the expected price."
125123 )
126-
You can’t perform that action at this time.
0 commit comments