Skip to content

Conversation

@GuillemCForgeFlow
Copy link

@GuillemCForgeFlow GuillemCForgeFlow commented Jan 2, 2026

We add the _subscribe_job_creator method in queue.job which will return True for the cases where we want to subscribe the job creator, False otherwise.

cc @ForgeFlow

@OCA-git-bot
Copy link
Contributor

Hi @guewen,
some modules you are maintaining are being modified, check this out!

@GuillemCForgeFlow GuillemCForgeFlow force-pushed the 17.0-imp-queue_job-hook_users_notify branch from 53b1975 to f35df77 Compare January 2, 2026 11:08
@GuillemCForgeFlow
Copy link
Author

hi @guewen, any chance you see this a good improvement to the module?
thank you in advance 🙂

@sbidoul sbidoul added this to the 17.0 milestone Jan 2, 2026
@sbidoul
Copy link
Member

sbidoul commented Jan 2, 2026

@GuillemCForgeFlow why is it not sufficient for you to override _subscribe_users_domain ?

@GuillemCForgeFlow
Copy link
Author

@GuillemCForgeFlow why is it not sufficient for you to override _subscribe_users_domain ?

@sbidoul, the problem is that the user assigned to the job will always be added anyway: https://github.com/OCA/queue/blob/17.0/queue_job/models/queue_job.py#L359. There may be cases for which we don't want that to happen.
I was also thinking about solving with queue_job_subscribe but thought this would be best. Any ideas on how to solve alternatively are welcomed 🙂

@sbidoul
Copy link
Member

sbidoul commented Jan 5, 2026

the problem is that the user assigned to the job will always be added anyway

Ah yes.

How about this?

def _subscribe_job_creator(self) -> bool
    """Whether the user that created the job should be subscribed to the job, in addition to users determined by `_subscribe_users_domain`"""

…ethod

We add the `_subscribe_job_creator` method in `queue.job` which will return True for the cases where we want to subscribe the job creator, False otherwise.
@GuillemCForgeFlow GuillemCForgeFlow force-pushed the 17.0-imp-queue_job-hook_users_notify branch from f35df77 to 5487166 Compare January 7, 2026 06:32
@GuillemCForgeFlow GuillemCForgeFlow changed the title [17.0][IMP]queue_job: hook for users to notify on job failure [17.0][IMP]queue_job: only subscribe job creator if indicated via boolean method Jan 7, 2026
@GuillemCForgeFlow
Copy link
Author

@sbidoul changes applied, thank you for the feedback 🙂 👍🏿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants