mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-12 11:35:57 +03:00
Fix key and type variable names for mysql
This commit is contained in:
@@ -21,7 +21,7 @@ pub struct UserOrganization {
|
||||
pub org_uuid: String,
|
||||
|
||||
pub access_all: bool,
|
||||
pub key: String,
|
||||
pub akey: String,
|
||||
pub status: i32,
|
||||
pub atype: i32,
|
||||
}
|
||||
@@ -196,7 +196,7 @@ impl UserOrganization {
|
||||
org_uuid,
|
||||
|
||||
access_all: false,
|
||||
key: String::new(),
|
||||
akey: String::new(),
|
||||
status: UserOrgStatus::Accepted as i32,
|
||||
atype: UserOrgType::User as i32,
|
||||
}
|
||||
@@ -266,7 +266,7 @@ impl UserOrganization {
|
||||
"MaxStorageGb": 10, // The value doesn't matter, we don't check server-side
|
||||
|
||||
// These are per user
|
||||
"Key": self.key,
|
||||
"Key": self.akey,
|
||||
"Status": self.status,
|
||||
"Type": self.atype,
|
||||
"Enabled": true,
|
||||
|
@@ -163,7 +163,7 @@ impl User {
|
||||
|
||||
pub fn delete(self, conn: &DbConn) -> EmptyResult {
|
||||
for user_org in UserOrganization::find_by_user(&self.uuid, &*conn) {
|
||||
if user_org.type_ == UserOrgType::Owner {
|
||||
if user_org.atype == UserOrgType::Owner {
|
||||
let owner_type = UserOrgType::Owner as i32;
|
||||
if UserOrganization::find_by_org_and_type(&user_org.org_uuid, owner_type, &conn).len() <= 1 {
|
||||
err!("Can't delete last owner")
|
||||
|
Reference in New Issue
Block a user