More float fixes in service

This commit is contained in:
DarkPhoenix
2011-06-13 21:18:28 +04:00
parent 29bb52398e
commit 5e2e504b26
2 changed files with 8 additions and 7 deletions

View File

@@ -28,6 +28,10 @@ class Attribute():
return cls.instance
def getAttributeInfo(self, attributeName):
info = eos.db.getAttributeInfo(attributeName, eager=("icon", "unit"))
def getAttributeInfo(self, identity):
if isinstance(identity, (int, basestring)):
info = eos.db.getAttributeInfo(identity, eager=("icon", "unit"))
elif isinstance(identity, (int, float)):
id = int(identity)
info = eos.db.getAttributeInfo(id, eager=("icon", "unit"))
return info

View File

@@ -323,11 +323,8 @@ class Market():
if isinstance(identity, eos.types.Group):
return identity
elif isinstance(identity, (int, float, basestring)):
# Attempt to convert float to int
try:
id = int(identity)
except ValueError:
id = None
if isinstance(identity, float):
identity = int(identity)
# Check custom groups
for cgrp in self.customGroups:
# During first comparison we need exact int, not float for matching