1
0
mirror of https://github.com/linkedin/oncall.git synced 2025-11-27 23:18:38 +02:00

Merge pull request #223 from dwang159/minor

Fix potential 5xx, move dataTables to bundle for CSP
This commit is contained in:
Fellyn Silliman
2018-10-22 19:36:20 -04:00
committed by GitHub
3 changed files with 7 additions and 7 deletions

View File

@@ -84,8 +84,12 @@ def on_post(req, resp):
now = time.time()
cursor.execute('SELECT `id` FROM `user` WHERE `name` = %s', user)
user_id = cursor.fetchone()['id']
team_id = events[0]['team_id']
user_id = cursor.fetchone()
if not (events and user_id):
raise HTTPBadRequest('Invalid name or list of events')
else:
user_id = user_id['id']
team_id = events[0]['team_id']
check_calendar_auth_by_id(team_id, req)
# Check that events are not in the past

View File

@@ -24,11 +24,8 @@ assets_env = AssetsEnvironment(path.join(STATIC_ROOT, 'static'),
assets_env.register('libs', Bundle(
'js/jquery-3.3.1.min.js', 'js/handlebars-4.0.12.min.js', 'js/bootstrap.min.js',
'js/moment.js', 'js/moment-timezone.js', 'js/moment-tz-data.js',
'js/typeahead.js',
'js/typeahead.js', 'js/jquery.dataTables.min.js',
output='bundles/libs.js'))
assets_env.register('datatables_js', Bundle(
'js/jquery.dataTables.min.js',
output='bundles/dataTables.js'))
assets_env.register('oncall_js', Bundle(
'js/navigo.js', 'js/incalendar.js', 'js/oncall.js',
output='bundles/oncall.bundle.js'))

View File

@@ -2430,7 +2430,6 @@ var oncall = {
init: function(name){
var start_time = moment().subtract(30, 'days');
this.data.teamName = decodeURIComponent(name);
$.getScript('/static/bundles/dataTables.js');
this.getData(start_time);
},
events: function(){