Skip to content

Commit 6b95a96

Browse files
author
Milan Topuzov
committed
models(base): fix auto-delay wrapper binding to use unbound origin
Set origin to class function and bind at call time; resolves TypeError in auto-delay tests. No functional change outside patching helper.
1 parent 4da8114 commit 6b95a96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

queue_job/models/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,9 @@ def auto_delay_wrapper(self, *args, **kwargs):
232232
delayed = self.with_delay(**job_options)
233233
return getattr(delayed, method_name)(*args, **kwargs)
234234

235-
origin = getattr(self, method_name)
236-
return functools.update_wrapper(auto_delay_wrapper, origin)
235+
origin_func = getattr(type(self), method_name)
236+
auto_delay_wrapper.origin = origin_func
237+
return functools.update_wrapper(auto_delay_wrapper, origin_func)
237238

238239
@api.model
239240
def _job_store_values(self, job):

0 commit comments

Comments
 (0)