Commits

Maciej Wiśniowski  committed 7e79c69

fixed value calculations for properties

  • Participants
  • Parent commits 3a3c3cb

Comments (0)

Files changed (1)

File lfs/order/models.py

         """
         properties = []
         for property_value in self.properties.all():
-
+            price = ""
             if property_value.property.is_select_field:
                 try:
                     option = PropertyOption.objects.get(pk=int(float(property_value.value)))
                 else:
                     value = option.name
                     price = option.price
-            else:
+            elif property_value.property.is_number_field:
                 format_string = "%%.%sf" % property_value.property.decimal_places
                 try:
                     value = format_string % float(property_value.value)
                 except ValueError:
                     value = "%.2f" % float(property_value.value)
-
-                price = ""
+            else:
+                value = property_value.value
 
             properties.append({
                 "name": property_value.property.name,