parent
cea4ad2d85
commit
b8c74bbb17
6 changed files with 28 additions and 56 deletions
|
@ -118,21 +118,21 @@ def user_view(user):
|
|||
'super_user': superusers.is_superuser(user.username)
|
||||
}
|
||||
|
||||
@resource('/v1/superuser/usage/')
|
||||
@resource('/v1/superuser/changelog/')
|
||||
@internal_only
|
||||
@show_if(features.SUPER_USERS)
|
||||
class UsageInformation(ApiResource):
|
||||
""" Resource for returning the usage information for enterprise customers. """
|
||||
class ChangeLog(ApiResource):
|
||||
""" Resource for returning the change log for enterprise customers. """
|
||||
@require_fresh_login
|
||||
@verify_not_prod
|
||||
@nickname('getSystemUsage')
|
||||
@nickname('getChangeLog')
|
||||
def get(self):
|
||||
""" Returns the number of repository handles currently held. """
|
||||
""" Returns the change log for this installation. """
|
||||
if SuperUserPermission().can():
|
||||
return {
|
||||
'usage': model.get_repository_usage(),
|
||||
'allowed': app.config.get('MAXIMUM_REPOSITORY_USAGE', 20)
|
||||
}
|
||||
with open ('CHANGELOG.md', 'r') as f:
|
||||
return {
|
||||
'log': f.read()
|
||||
}
|
||||
|
||||
abort(403)
|
||||
|
||||
|
|
Reference in a new issue