feature/events #18

Merged
crimsen merged 4 commits from feature/events into develop 2021-11-25 17:00:41 +00:00
2 changed files with 21 additions and 3 deletions
Showing only changes of commit e626239d84 - Show all commits

View File

@ -336,7 +336,16 @@ def respond_invitation(invite: Invitation, accepted=True):
raise Conflict raise Conflict
if not accepted: if not accepted:
EventPlugin.plugin.notify(inviter, _("Invitation rejected"), {"type": NotifyType.INVITATION_REJECTED, "event": job.event_id_, "job": invite.job_id, "invitee": invite.invitee_id}) EventPlugin.plugin.notify(
inviter,
_("Invitation rejected"),
{
"type": NotifyType.INVITATION_REJECTED,
"event": job.event_id_,
"job": invite.job_id,
"invitee": invite.invitee_id,
},
)
else: else:
if invite.transferee_id is None: if invite.transferee_id is None:
assign_job(job, invite.invitee_, 1) assign_job(job, invite.invitee_, 1)
@ -346,7 +355,16 @@ def respond_invitation(invite: Invitation, accepted=True):
raise Conflict raise Conflict
unassign_job(job, invite.transferee_, service[0], True) unassign_job(job, invite.transferee_, service[0], True)
assign_job(job, invite.invitee_, service[0].value) assign_job(job, invite.invitee_, service[0].value)
EventPlugin.plugin.notify(inviter, _("Invitation accepted"), {"type": NotifyType.INVITATION_ACCEPTED, "event": job.event_id_, "job": invite.job_id, "invitee": invite.invitee_id}) EventPlugin.plugin.notify(
inviter,
_("Invitation accepted"),
{
"type": NotifyType.INVITATION_ACCEPTED,
"event": job.event_id_,
"job": invite.job_id,
"invitee": invite.invitee_id,
},
)
@scheduled @scheduled