File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -607,9 +607,24 @@ public void SeedDatabase(string connectionString)
607607 {
608608 // Get DbContext
609609 var contextFactory = new TimePlanningPnContextFactory ( ) ;
610- using var context = contextFactory . CreateDbContext ( [ connectionString ] ) ;
610+ using var dbContext = contextFactory . CreateDbContext ( [ connectionString ] ) ;
611+
612+ var activeAssignedSites = dbContext . AssignedSites
613+ . Where ( x => x . WorkflowState != Constants . WorkflowStates . Removed ) . ToList ( ) ;
614+
615+ foreach ( var activeAssignedSite in activeAssignedSites )
616+ {
617+ if ( activeAssignedSite . AllowPersonalTimeRegistration )
618+ {
619+ activeAssignedSite . EnableMobileAccess = true ;
620+ activeAssignedSite . Update ( dbContext ) ;
621+ dbContext . SaveChanges ( ) ;
622+ }
623+ }
624+
625+
611626 // Seed configuration
612- TimePlanningPluginSeed . SeedData ( context ) ;
627+ TimePlanningPluginSeed . SeedData ( dbContext ) ;
613628 }
614629
615630 public PluginPermissionsManager GetPermissionsManager ( string connectionString )
You can’t perform that action at this time.
0 commit comments