Skip to content

Commit

Permalink
Not respecting Django specs. (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
mindflayer authored and auvipy committed Nov 7, 2016
1 parent 6232c79 commit e570a0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion djcelery/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def update_or_create(self, **kwargs):
fields.update(kwargs)
update_model_with_dict(obj, fields)

return obj
return obj, created


class ExtendedManager(models.Manager):
Expand Down
5 changes: 3 additions & 2 deletions djcelery/schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ def from_entry(cls, name, skip_fields=('relative', 'options'), **entry):
fields['queue'] = options.get('queue')
fields['exchange'] = options.get('exchange')
fields['routing_key'] = options.get('routing_key')
return cls(PeriodicTask._default_manager.update_or_create(
obj, _ = PeriodicTask._default_manager.update_or_create(
name=name, defaults=fields,
))
)
return cls(obj)

def __repr__(self):
return '<ModelEntry: {0} {1}(*{2}, **{3}) {4}>'.format(
Expand Down
2 changes: 1 addition & 1 deletion djcelery/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def handle_worker(self, hostname_worker):
last_write, obj = self._last_worker_write[hostname]
if not last_write or \
monotonic() - last_write > self.worker_update_freq:
obj = self.WorkerState.objects.update_or_create(
obj, _ = self.WorkerState.objects.update_or_create(
hostname=hostname,
defaults={'last_heartbeat': self.get_heartbeat(worker)},
)
Expand Down

0 comments on commit e570a0d

Please sign in to comment.