Skip to content

Commit aa964f1

Browse files
debug: try to force a new admin creation
1 parent d631318 commit aa964f1

3 files changed

Lines changed: 2 additions & 23 deletions

File tree

school_data_hub_server/lib/src/_features/admin/endpoints/admin_endpoint.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class AdminEndpoint extends Endpoint {
4949
bool isAdmin = false;
5050

5151
for (final scope in scopeNames) {
52-
if (scope == 'admin') {
52+
if (scope.contains('admin')) {
5353
isAdmin = true;
5454
}
5555
}

school_data_hub_server/lib/src/helpers/create_first_admin.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ Future<User?> createFirstAdmin(
1010
) async {
1111
//- Create test admin
1212

13+
// For email authentication, we need to create a user with email/password
1314
final adminEmail = 'admin';
14-
15-
// For email authentication, you need to create a user with email/password
1615
final adminPassword = 'admin'; // Set a secure password in production
1716

1817
// Create the userinfo

school_data_hub_server/lib/src/helpers/populate_test_environment.dart

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,3 @@ Future<void> populateTestEnvironment(Session session) async {
8080
_log.severe('Error populating test environment: $e');
8181
}
8282
}
83-
84-
List<DateTime> generateWeekdays(DateTime start, DateTime end) {
85-
final List<DateTime> weekdays = [];
86-
87-
// Create a new DateTime starting at the first date
88-
DateTime current = start;
89-
90-
// Loop until we reach or pass the end date
91-
while (!current.isAfter(end)) {
92-
// Check if it's a weekday (1-5 are Monday to Friday)
93-
if (current.weekday >= 1 && current.weekday <= 5) {
94-
weekdays.add(DateTime(current.year, current.month, current.day));
95-
}
96-
97-
// Move to next day
98-
current = current.add(const Duration(days: 1));
99-
}
100-
101-
return weekdays;
102-
}

0 commit comments

Comments
 (0)