Skip to content

Commit

Permalink
Disable duplicate check on user import
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad committed Oct 2, 2024
1 parent dfc50ee commit 51c4394
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 29 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,6 @@ jobs:
run: dotnet build --configuration Release --no-restore
working-directory: dotnet-authserver

- name: Unit tests
uses: ./.github/workflows/actions/test
if: github.event_name != 'push'
with:
test_project_path: dotnet-authserver/tests/TeacherIdentity.AuthServer.Tests
report_name: "Unit test results"
dotnet_test_args: '-e ConnectionStrings__DefaultConnection="Host=localhost;Username=postgres;Password=teacher_identity;Database=teacher_identity"'

- name: Install Playwright
run: pwsh ./tests/TeacherIdentity.AuthServer.EndToEndTests/bin/Release/net7.0/playwright.ps1 install
if: github.event_name != 'push'
working-directory: dotnet-authserver

- name: End-to-end tests
uses: ./.github/workflows/actions/test
if: github.event_name != 'push'
with:
test_project_path: dotnet-authserver/tests/TeacherIdentity.AuthServer.EndToEndTests
report_name: "End-to-end test results"
dotnet_test_args: '-e AuthorizationServer__ConnectionStrings__DefaultConnection="Host=localhost;Username=postgres;Password=teacher_identity;Database=teacher_identity"'

- name: Publish
run: |
dotnet publish --configuration Release --no-build src/TeacherIdentity.AuthServer/TeacherIdentity.AuthServer.csproj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ public async Task Process(Guid userImportJobId)

var dateOfBirth = DateOnly.ParseExact(row!.DateOfBirth!, "ddMMyyyy", CultureInfo.InvariantCulture);
// Validate for potential duplicates
var existingUsers = await _userSearchService.FindUsers(firstName, lastName, dateOfBirth);
if (existingUsers.Any(u => u.EmailAddress != row.EmailAddress!))
{
errors.Add("Potential duplicate user");
userImportJobRow.Notes = errors;
userImportJobRow.UserImportRowResult = UserImportRowResult.Invalid;
}
else
//var existingUsers = await _userSearchService.FindUsers(firstName, lastName, dateOfBirth);
//if (existingUsers.Any(u => u.EmailAddress != row.EmailAddress!))
//{
// errors.Add("Potential duplicate user");
// userImportJobRow.Notes = errors;
// userImportJobRow.UserImportRowResult = UserImportRowResult.Invalid;
//}
//else
{
user = new User
{
Expand Down

0 comments on commit 51c4394

Please sign in to comment.