##// END OF EJS Templates
api: cleanup sessions enforce older_then must be a valid INT.
marcink -
r1407:cbdeb872 default
parent child Browse files
Show More
@@ -28,6 +28,7 b' from rhodecode.api.utils import ('
28 from rhodecode.lib.utils import repo2db_mapper
28 from rhodecode.lib.utils import repo2db_mapper
29 from rhodecode.lib import system_info
29 from rhodecode.lib import system_info
30 from rhodecode.lib import user_sessions
30 from rhodecode.lib import user_sessions
31 from rhodecode.lib.utils2 import safe_int
31 from rhodecode.model.db import UserIpMap
32 from rhodecode.model.db import UserIpMap
32 from rhodecode.model.scm import ScmModel
33 from rhodecode.model.scm import ScmModel
33
34
@@ -223,7 +224,7 b' def cleanup_sessions(request, apiuser, o'
223 if not has_superadmin_permission(apiuser):
224 if not has_superadmin_permission(apiuser):
224 raise JSONRPCForbidden()
225 raise JSONRPCForbidden()
225
226
226 older_then = Optional.extract(older_then)
227 older_then = safe_int(Optional.extract(older_then)) or 60
227 older_than_seconds = 60 * 60 * 24 * older_then
228 older_than_seconds = 60 * 60 * 24 * older_then
228
229
229 config = system_info.rhodecode_config().get_value()['value']['config']
230 config = system_info.rhodecode_config().get_value()['value']['config']
General Comments 0
You need to be logged in to leave comments. Login now