mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
submitrequest log: use the description of the submitrequest for the initial log entry otherwise its comment attribute would contain None
This commit is contained in:
parent
7dd72fd089
commit
1f2df92d12
@ -1978,6 +1978,12 @@ def get_submit_request_log(apiurl, reqid):
|
||||
r = get_submit_request(conf.config['apiurl'], reqid)
|
||||
data = []
|
||||
frmt = '-' * 76 + '\n%s | %s | %s\n\n%s'
|
||||
# the description of the submitrequest is used for the initial log entry
|
||||
# otherwise its comment attribute would contain None
|
||||
if len(r.statehistory) >= 1:
|
||||
r.statehistory[-1].comment = r.descr
|
||||
else:
|
||||
r.state.comment = r.descr
|
||||
for state in [ r.state ] + r.statehistory:
|
||||
s = frmt % (state.name, state.who, state.when, str(state.comment))
|
||||
data.append(s)
|
||||
|
Loading…
Reference in New Issue
Block a user