Skip to content

Commit

Permalink
fix regression on depends
Browse files Browse the repository at this point in the history
  • Loading branch information
htouvet committed Feb 9, 2018
1 parent 90fb725 commit 9c3cb95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions waptserver/waptserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1741,9 +1741,6 @@ def get_hosts():

req = Hosts.select(*build_fields_list(Hosts, columns)).limit(limit)

if 'depends' in columns:
req = req.join(HostGroups).group_by(Hosts.uuid,Hosts.computer_fqdn)

req = req.order_by(SQL('last_seen_on desc NULLS LAST'))
if query:
req = req.where(query)
Expand Down
2 changes: 2 additions & 0 deletions waptserver/waptserver_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,12 @@ class Hosts(WaptBaseModel):
dmi = BinaryJSONField(null=True)
wmi = BinaryJSONField(null=True)

"""
def save(self,*args,**argvs):
if 'uuid' in self._dirty:
argvs['force_insert'] = True
return super(Hosts,self).save(*args,**argvs)
"""

def __repr__(self):
return '<Host fqdn=%s / uuid=%s>' % (self.computer_fqdn, self.uuid)
Expand Down

0 comments on commit 9c3cb95

Please sign in to comment.