user positions

This commit is contained in:
j 2011-11-08 00:00:08 +01:00
parent 1ded5a0cd4
commit 6aec4ff1b1
2 changed files with 5 additions and 2 deletions

View file

@ -70,13 +70,16 @@ class SessionData(models.Model):
data.save()
return data
def get_id(self):
return self.user and ox.to26(self.user.id) or self.session_key
def json(self, keys=None, user=None):
j = {
'disabled': False,
'email': '',
'firstseen': self.firstseen,
'ip': self.ip,
'id': self.user and ox.to26(self.user.id) or self.session_key,
'id': self.get_id(),
'lastseen': self.lastseen,
'level': 'guest',
'notes': '',

View file

@ -515,7 +515,7 @@ Positions
if qs.count() > 0:
response['data']['position'] = utils.get_positions(ids, [qs[0].itemId])[0]
elif 'positions' in data:
ids = [ox.to26(i.id) for i in qs]
ids = [i.get_id() for i in qs]
response['data']['positions'] = utils.get_positions(ids, data['positions'])
else:
response['data']['items'] = qs.count()