diff --git a/LearningHub.Nhs.WebUI/Models/UserProfile/MyAccountPersonalDetailsViewModel.cs b/LearningHub.Nhs.WebUI/Models/UserProfile/MyAccountPersonalDetailsViewModel.cs
index d7f6eeaf..2ce51c9c 100644
--- a/LearningHub.Nhs.WebUI/Models/UserProfile/MyAccountPersonalDetailsViewModel.cs
+++ b/LearningHub.Nhs.WebUI/Models/UserProfile/MyAccountPersonalDetailsViewModel.cs
@@ -26,7 +26,6 @@ public class MyAccountPersonalDetailsViewModel
///
/// Gets or sets the FirstName.
///
- [Required(ErrorMessage = "Enter a first name")]
[StringLength(50, MinimumLength = 1, ErrorMessage = "First name must be less than 50 characters.")]
[DisplayName("First name")]
public string FirstName { get; set; }
@@ -34,7 +33,6 @@ public class MyAccountPersonalDetailsViewModel
///
/// Gets or sets the LastName.
///
- [Required(ErrorMessage = "Enter a last name")]
[StringLength(50, MinimumLength = 1, ErrorMessage = "Last name must be less than 50 characters.")]
[DisplayName("Last name")]
public string LastName { get; set; }
diff --git a/LearningHub.Nhs.WebUI/Services/UserService.cs b/LearningHub.Nhs.WebUI/Services/UserService.cs
index 5a3faf99..e0e4261f 100644
--- a/LearningHub.Nhs.WebUI/Services/UserService.cs
+++ b/LearningHub.Nhs.WebUI/Services/UserService.cs
@@ -1943,8 +1943,6 @@ public async Task UpdateMyAccountPersonalDetailsAsync(int userId, MyAccountPerso
PersonalDetailsViewModel personalDetailsViewModel = new PersonalDetailsViewModel
{
UserId = userId,
- FirstName = model.FirstName.Trim(),
- LastName = model.LastName.Trim(),
PreferredName = model.PreferredName?.Trim(),
SecondaryEmailAddress = model.SecondaryEmailAddress,
};
diff --git a/LearningHub.Nhs.WebUI/Views/MyAccount/ChangePersonalDetails.cshtml b/LearningHub.Nhs.WebUI/Views/MyAccount/ChangePersonalDetails.cshtml
index a4b76cbb..d5103afd 100644
--- a/LearningHub.Nhs.WebUI/Views/MyAccount/ChangePersonalDetails.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/MyAccount/ChangePersonalDetails.cshtml
@@ -1,23 +1,25 @@
@model LearningHub.Nhs.WebUI.Models.UserProfile.MyAccountPersonalDetailsViewModel
@{
- ViewData["DisableValidation"] = true;
- ViewData["Title"] = "My Account - Change first name";
- var errorHasOccurred = !ViewData.ModelState.IsValid;
+ ViewData["DisableValidation"] = true;
+ ViewData["Title"] = "My Account - Change first name";
+ var errorHasOccurred = !ViewData.ModelState.IsValid;
}
\ No newline at end of file