Skip to content

Commit

Permalink
Extend pending signing jobs with editors
Browse files Browse the repository at this point in the history
  • Loading branch information
elioschmutz committed Dec 13, 2024
1 parent 4872bc7 commit 421cece
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions opengever/sign/pending_signing_job.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from datetime import datetime
from opengever.sign.pending_editor import PendingEditor
from opengever.sign.pending_editor import PendingEditors
from opengever.sign.pending_signer import PendingSigner
from opengever.sign.pending_signer import PendingSigners
from opengever.sign.signed_version import SignedVersion
Expand All @@ -7,11 +9,13 @@


class PendingSigningJob(Persistent):

def __init__(self,
created=None,
userid='',
version=0,
signers=list(),
editors=list(),
job_id='',
redirect_url='',
):
Expand All @@ -20,6 +24,7 @@ def __init__(self,
self.userid = userid
self.version = version
self.signers = PendingSigners([PendingSigner(email=signer) for signer in signers])
self.editors = PendingEditors([PendingEditor(email=editors) for editors in editors])
self.job_id = job_id
self.redirect_url = redirect_url

Expand All @@ -30,6 +35,7 @@ def serialize(self):
'job_id': self.job_id,
'redirect_url': self.redirect_url,
'signers': self.signers.serialize(),
'editors': self.editors.serialize(),
'version': self.version,
})

Expand Down
7 changes: 7 additions & 0 deletions opengever/sign/tests/test_pending_signing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def test_can_be_serialized(self):
userid='foo.bar',
version=1,
signers=['[email protected]'],
editors=['[email protected]'],
job_id='1',
redirect_url='[email protected]')

Expand All @@ -41,6 +42,12 @@ def test_can_be_serialized(self):
'userid': '',
}
],
'editors': [
{
'email': '[email protected]',
'userid': '',
}
],
'job_id': '1',
'redirect_url': '[email protected]'
}, metadata.serialize())
Expand Down

0 comments on commit 421cece

Please sign in to comment.