vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit d594b5a266d7876b8879c56c8ac29d5af854d06e
parent 08b168a0a1f91851dd631b27f4b47a15f67545e0
Author: Daniel GarcĂ­a <dani-garcia@users.noreply.github.com>
Date:   Sun, 22 Aug 2021 22:14:14 +0200

Merge branch 'jjlin-fix-attachment-sharing' into main

Diffstat:
Msrc/api/core/ciphers.rs | 6------
Msrc/db/models/attachment.rs | 10----------
2 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs @@ -687,12 +687,6 @@ fn put_cipher_share_selected( }; } - let attachments = Attachment::find_by_ciphers(cipher_ids, &conn); - - if !attachments.is_empty() { - err!("Ciphers should not have any attachments.") - } - while let Some(cipher) = data.Ciphers.pop() { let mut shared_cipher_data = ShareCipherData { Cipher: cipher, diff --git a/src/db/models/attachment.rs b/src/db/models/attachment.rs @@ -143,16 +143,6 @@ impl Attachment { }} } - pub fn find_by_ciphers(cipher_uuids: Vec<String>, conn: &DbConn) -> Vec<Self> { - db_run! { conn: { - attachments::table - .filter(attachments::cipher_uuid.eq_any(cipher_uuids)) - .load::<AttachmentDb>(conn) - .expect("Error loading attachments") - .from_db() - }} - } - pub fn size_by_user(user_uuid: &str, conn: &DbConn) -> i64 { db_run! { conn: { let result: Option<i64> = attachments::table