Skip to content

Commit

Permalink
Merge pull request #793 from trishnaguha/time-to-stable
Browse files Browse the repository at this point in the history
Modifying days to stable
  • Loading branch information
lmacken committed Mar 8, 2016
2 parents b212fc8 + f297ddb commit 3812a55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions bodhi/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1772,12 +1772,10 @@ def met_testing_requirements(self):
@property
def days_to_stable(self):
""" Return the number of days until an update can be pushed to stable """
for comment in self.comments:
if comment.user.name == 'bodhi' and \
'can be pushed to stable now if the ' \
'maintainer wishes' in comment.text:
return (comment.timestamp - self.date_submitted).days
return 0
if self.meets_testing_requirements:
return self.release.mandatory_days_in_testing - (datetime.utcnow() - self.date_testing).days
else:
return 0

@property
def days_in_testing(self):
Expand Down
2 changes: 1 addition & 1 deletion bodhi/templates/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ <h1>
</tr>
% endif

% if update.days_to_stable:
% if update.days_to_stable and update.status.description == 'testing':
<tr>
<td>Days to Stable</td>
<td>${update.days_to_stable}</td>
Expand Down

0 comments on commit 3812a55

Please sign in to comment.