mirror of
https://github.com/bitwarden/server.git
synced 2024-12-22 16:57:36 +01:00
Verify Send file does not exist before saving file (#1515)
* Verify Send file does not exist before saving file * Fix flaky test
This commit is contained in:
parent
48aa54949b
commit
1779d33a66
@ -130,6 +130,11 @@ namespace Bit.Core.Services
|
||||
|
||||
var data = JsonConvert.DeserializeObject<SendFileData>(send.Data);
|
||||
|
||||
if (data.Validated)
|
||||
{
|
||||
throw new BadRequestException("File has already been uploaded.");
|
||||
}
|
||||
|
||||
await _sendFileStorageService.UploadNewFileAsync(stream, send, data.Id);
|
||||
|
||||
if (!await ValidateSendFile(send))
|
||||
|
@ -79,6 +79,7 @@ namespace Bit.Core.Test.Services
|
||||
List<ImportedOrganizationUser> newUsers)
|
||||
{
|
||||
org.UseDirectory = true;
|
||||
org.Seats = newUsers.Count + existingUsers.Count + 1;
|
||||
var reInvitedUser = existingUsers.First();
|
||||
reInvitedUser.ExternalId = null;
|
||||
newUsers.Add(new ImportedOrganizationUser
|
||||
|
Loading…
Reference in New Issue
Block a user