@@ -269,9 +269,9 @@ app.get('/instances/',
269269 ownerIsHelloRunnable ( 'query' )
270270 ) ,
271271 instances . find ( 'query' ) ,
272- timers . model . startTimer ( 'getGithubUsername ' ) ,
273- instances . getGithubUsernamesForInstances ( 'sessionUser' , 'instances' ) ,
274- timers . model . stopTimer ( 'getGithubUsername ' ) ,
272+ timers . model . startTimer ( 'populateOwnerAndCreatedByForInstances ' ) ,
273+ instances . populateOwnerAndCreatedByForInstances ( 'sessionUser' , 'instances' ) ,
274+ timers . model . stopTimer ( 'populateOwnerAndCreatedByForInstances ' ) ,
275275 timers . model . startTimer ( 'instance-route.populateModels' ) ,
276276 instances . models . populateModels ( ) ,
277277 timers . model . stopTimer ( 'instance-route.populateModels' ) ,
@@ -348,7 +348,7 @@ app.post('/instances/',
348348 error . logIfErrMw ) ,
349349 mw . next ( 'err' ) // next error
350350 ) ,
351- instances . model . getGithubUsername ( 'sessionUser' ) ,
351+ instances . model . populateOwnerAndCreatedBy ( 'sessionUser' ) ,
352352 instances . model . populateModels ( ) ,
353353 messenger . emitInstanceUpdate ( 'instance' , 'post' ) ,
354354 mw . res . send ( 201 , 'instance' ) ) ;
@@ -362,7 +362,7 @@ app.get('/instances/:id',
362362 me . isOwnerOf ( 'instance' ) ,
363363 instances . model . isPublic ( ) ,
364364 me . isModerator ) ,
365- instances . model . getGithubUsername ( 'sessionUser' ) ,
365+ instances . model . populateOwnerAndCreatedBy ( 'sessionUser' ) ,
366366 instances . model . populateModels ( ) ,
367367 mw . res . json ( 'instance' ) ) ;
368368
@@ -528,7 +528,7 @@ app.patch('/instances/:id',
528528 instances . model . update ( { $set : 'body' } ) ,
529529 instances . findById ( 'instanceId' ) ) ,
530530 instances . findById ( 'instanceId' ) ,
531- instances . model . getGithubUsername ( 'sessionUser' ) ,
531+ instances . model . populateOwnerAndCreatedBy ( 'sessionUser' ) ,
532532 mw . body ( { or : [ 'name' , 'env' ] } ) . require ( )
533533 . then (
534534 // acquire lock
@@ -695,7 +695,7 @@ app.post('/instances/:id/actions/deploy',
695695 // create container
696696 createSaveAndNetworkContainer ,
697697 graph . create ( ) ,
698- instances . model . getGithubUsername ( 'sessionUser' ) ,
698+ instances . model . populateOwnerAndCreatedBy ( 'sessionUser' ) ,
699699 graph . model . graphInstanceDeps ( 'instance' ) )
700700 . catch (
701701 mw . req ( ) . setToErr ( 'err' ) ,
@@ -755,7 +755,7 @@ app.post('/instances/:id/actions/redeploy',
755755 // create container
756756 createSaveAndNetworkContainer ,
757757 graph . create ( ) ,
758- instances . model . getGithubUsername ( 'sessionUser' ) ,
758+ instances . model . populateOwnerAndCreatedBy ( 'sessionUser' ) ,
759759 graph . model . graphInstanceDeps ( 'instance' ) )
760760 . catch (
761761 mw . req ( ) . setToErr ( 'err' ) ,
@@ -937,7 +937,7 @@ app.post('/instances/:id/actions/regraph',
937937 checkFound ( 'user' , 'Owner not found' ) ,
938938 mw . req ( ) . set ( 'ownerUsername' , 'user.login' ) ,
939939 graph . create ( ) ,
940- instances . model . getGithubUsername ( 'sessionUser' ) ,
940+ instances . model . populateOwnerAndCreatedBy ( 'sessionUser' ) ,
941941 graph . model . graphInstanceDeps ( 'instance' ) ,
942942 instances . model . populateModels ( ) ,
943943 mw . req ( ) . set ( 'instance.owner.username' , 'ownerUsername' ) ,
0 commit comments