Commit d2f1c06e authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Remove unnecessary checks

parent 4ee5d5d3
...@@ -652,7 +652,7 @@ namespace Coscine.Api.Project.Controllers ...@@ -652,7 +652,7 @@ namespace Coscine.Api.Project.Controllers
x.Expiration > DateTime.UtcNow x.Expiration > DateTime.UtcNow
); );
if (invitations != null && invitations.Any()) if (invitations.Any())
{ {
return BadRequest("This invitee already has a valid invitation to this project."); return BadRequest("This invitee already has a valid invitation to this project.");
} }
...@@ -663,12 +663,9 @@ namespace Coscine.Api.Project.Controllers ...@@ -663,12 +663,9 @@ namespace Coscine.Api.Project.Controllers
x.Expiration <= DateTime.UtcNow x.Expiration <= DateTime.UtcNow
); );
if (expiredInvitations != null && expiredInvitations.Any()) foreach (var expiredInvitation in expiredInvitations)
{ {
foreach (var expiredInvitation in expiredInvitations) _invitationModel.Delete(expiredInvitation);
{
_invitationModel.Delete(expiredInvitation);
}
} }
var token = _invitationModel.CreateInvitation(sendInvitationObject.Project, user.Id, sendInvitationObject.Role, sendInvitationObject.Email); var token = _invitationModel.CreateInvitation(sendInvitationObject.Project, user.Id, sendInvitationObject.Role, sendInvitationObject.Email);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment