mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-25 17:36:13 +01:00
- show warning on auto accepting requests
This commit is contained in:
parent
bdc772ef10
commit
1c412c14ee
@ -2390,6 +2390,7 @@ class Request:
|
|||||||
self.title = ''
|
self.title = ''
|
||||||
self.description = ''
|
self.description = ''
|
||||||
self.state = None
|
self.state = None
|
||||||
|
self.accept_at = None
|
||||||
self.actions = []
|
self.actions = []
|
||||||
self.statehistory = []
|
self.statehistory = []
|
||||||
self.reviews = []
|
self.reviews = []
|
||||||
@ -2415,6 +2416,8 @@ class Request:
|
|||||||
self.reviews.append(ReviewState(review))
|
self.reviews.append(ReviewState(review))
|
||||||
for hist_state in root.findall('history'):
|
for hist_state in root.findall('history'):
|
||||||
self.statehistory.append(RequestState(hist_state))
|
self.statehistory.append(RequestState(hist_state))
|
||||||
|
if not root.find('accept_at') is None and root.find('accept_at').text:
|
||||||
|
self.accept_at = root.find('accept_at').text.strip()
|
||||||
if not root.find('title') is None:
|
if not root.find('title') is None:
|
||||||
self.title = root.find('title').text.strip()
|
self.title = root.find('title').text.strip()
|
||||||
if not root.find('description') is None and root.find('description').text:
|
if not root.find('description') is None and root.find('description').text:
|
||||||
@ -2566,6 +2569,9 @@ class Request:
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
"""return "detailed" format"""
|
"""return "detailed" format"""
|
||||||
lines = ['Request: #%s\n' % self.reqid]
|
lines = ['Request: #%s\n' % self.reqid]
|
||||||
|
if self.accept_at and self.state.name in [ 'new', 'review' ]:
|
||||||
|
lines.append(' *** This request will get automatically accepted after '+self.accept_at+' ! ***\n')
|
||||||
|
|
||||||
for action in self.actions:
|
for action in self.actions:
|
||||||
tmpl = ' %(type)-13s %(source)s %(target)s'
|
tmpl = ' %(type)-13s %(source)s %(target)s'
|
||||||
if action.type == 'delete':
|
if action.type == 'delete':
|
||||||
|
Loading…
Reference in New Issue
Block a user