Skip to content

Commit

Permalink
Decimal for this is 💰
Browse files Browse the repository at this point in the history
  • Loading branch information
regiscamimura committed Oct 13, 2023
1 parent 832deac commit 3bfbb46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion worf/validators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime, time
from decimal import *
from uuid import UUID

from django.core.exceptions import ValidationError
Expand Down Expand Up @@ -126,7 +127,7 @@ def _validate_decimal(self, key):
return None

try:
decimal = float(value)
decimal = Decimal(value)
except (TypeError, ValueError):
raise ValidationError(f"Field {self.keymap[key]} accepts an decimal")

Expand Down

0 comments on commit 3bfbb46

Please sign in to comment.