Merge pull request #3003 from coreos-inc/joseph.schorr/QUAY-808/expired-app-token-banner

Small fixes for expiring-soon app tokens banner
This commit is contained in:
josephschorr 2018-02-12 17:28:21 -05:00 committed by GitHub
commit 8ba2e71fb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -60,7 +60,8 @@ def get_expiring_tokens(user, soon):
return (AppSpecificAuthToken
.select()
.where(AppSpecificAuthToken.user == user,
AppSpecificAuthToken.expiration <= soon_datetime))
AppSpecificAuthToken.expiration <= soon_datetime,
AppSpecificAuthToken.expiration > datetime.now()))
def gc_expired_tokens(user):

View file

@ -2,7 +2,7 @@
<div ng-repeat="token in NotificationService.expiringAppTokens">
<div class="quay-service-status-description warning">
Your external application token <strong style="display: inline-block; padding: 4px;">{{ token.title }}</strong>
will be expiring <strong style="display: inline-block; padding: 4px;"><time-ago datetime="token.expiration"></time-ago></strong>.
will be expiring in <strong style="display: inline-block; padding: 4px;"><time-ago datetime="token.expiration"></time-ago></strong>.
Please create a new token and revoke this token in user settings.
</div>
</div>