cards: display first history step with agent name (#39667)

This commit is contained in:
Frédéric Péters 2020-02-22 10:57:20 +01:00
parent 1f3af36747
commit 49ec7bdc11
2 changed files with 15 additions and 0 deletions

View File

@ -5516,6 +5516,13 @@ def test_carddata_management(pub, studio):
assert 'Edit Card' in resp.text
assert 'Delete Card' in resp.text
carddata = carddef.data_class().select()[0]
assert carddata.data == {'1': 'ok', '2': 'blah'}
assert carddata.user_id is None
assert carddata.submission_context == {'agent_id': user.id}
assert carddata.evolution[0].who == str(user.id)
assert 'Original Submitter' not in resp.text
resp = app.get('/backoffice/data/')
resp = resp.click('foo')
assert resp.text.count('<tr') == 2 # header + row of data

View File

@ -47,3 +47,11 @@ class CardData(FormData):
def get_display_label(self):
return self.digest or self.get_display_name()
def get_author_qualification(self):
return None
def just_created(self):
super(CardData, self).just_created()
if self.submission_context and 'agent_id' in self.submission_context:
self.evolution[0].who = self.submission_context['agent_id']