mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-10 21:13:53 +00:00
Fix invite empty email
This commit is contained in:
parent
b8cabadd43
commit
ddd49596ba
2 changed files with 9 additions and 1 deletions
|
@ -137,6 +137,10 @@ impl User {
|
|||
}
|
||||
|
||||
pub fn save(&mut self, conn: &DbConn) -> EmptyResult {
|
||||
if self.email.trim().is_empty() {
|
||||
err!("User email can't be empty")
|
||||
}
|
||||
|
||||
self.updated_at = Utc::now().naive_utc();
|
||||
|
||||
diesel::replace_into(users::table) // Insert or update
|
||||
|
@ -213,6 +217,10 @@ impl Invitation {
|
|||
}
|
||||
|
||||
pub fn save(&mut self, conn: &DbConn) -> EmptyResult {
|
||||
if self.email.trim().is_empty() {
|
||||
err!("Invitation email can't be empty")
|
||||
}
|
||||
|
||||
diesel::replace_into(invitations::table)
|
||||
.values(&*self)
|
||||
.execute(&**conn)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue