[cleanup] Minor pep8 cleanup

This commit is contained in:
Ferdinand Thiessen 2021-11-25 15:44:37 +01:00
parent d40e3e29b5
commit 8bc096c0ab
2 changed files with 21 additions and 3 deletions

View File

@ -114,7 +114,7 @@ class AuthLDAP(AuthPlugin):
}
)
if user.display_name:
attributes.update( {"displayName": user.display_name})
attributes.update({"displayName": user.display_name})
ldap_conn.add(dn, self.object_classes, attributes)
self._set_roles(user)
self.update_user(user)

View File

@ -336,7 +336,16 @@ def respond_invitation(invite: Invitation, accepted=True):
raise Conflict
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:
if invite.transferee_id is None:
assign_job(job, invite.invitee_, 1)
@ -346,7 +355,16 @@ def respond_invitation(invite: Invitation, accepted=True):
raise Conflict
unassign_job(job, invite.transferee_, service[0], True)
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