-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[PM-26772] Importing Archived Ciphers #6452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Reportโ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6452 +/- ##
==========================================
+ Coverage 50.73% 54.81% +4.07%
==========================================
Files 1866 1866
Lines 82705 82704 -1
Branches 7310 7321 +11
==========================================
+ Hits 41961 45332 +3371
+ Misses 39143 35690 -3453
- Partials 1601 1682 +81 โ View full report in Codecov by Sentry. ๐ New features to boost your workflow:
|
Great job! No new security vulnerabilities introduced in this pull request |
var archivedCiphers = model.Ciphers.Where(c => c.ArchivedDate.HasValue).ToList(); | ||
if (archivedCiphers.Any()) | ||
{ | ||
throw new BadRequestException("You cannot import archived items into an organization."); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any()
to filter, as it will exit as soon as it finds a match. Calling Where()
and ToList()
will execute on all ciphers to create a separate List of ciphers, which then is just checked once and not needed anymore.
var archivedCiphers = model.Ciphers.Where(c => c.ArchivedDate.HasValue).ToList(); | |
if (archivedCiphers.Any()) | |
{ | |
throw new BadRequestException("You cannot import archived items into an organization."); | |
} | |
if (model.Ciphers.Any(c => c.ArchivedDate.HasValue)) | |
{ | |
throw new BadRequestException("You cannot import archived items into an organization."); | |
} | |
); | ||
} | ||
|
||
[Theory, BitAutoData] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐๏ธ Tracking
PM-26772
๐ Objective
When importing archived ciphers:
๐ฆฎ Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or โน๏ธ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or ๐ญ (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or โป๏ธ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes