mirror of
https://github.com/simple-login/app.git
synced 2024-11-13 07:31:12 +01:00
Fix recreate alias from trash (#1641)
* no need to check for a deleted alias that belongs to user domain * fix config.SAVE_UNSENT_DIR not set
This commit is contained in:
parent
26d5fd400c
commit
b6286e3c1b
2 changed files with 7 additions and 13 deletions
|
@ -120,18 +120,11 @@ def custom_alias():
|
|||
email=full_alias
|
||||
)
|
||||
custom_domain = domain_deleted_alias.domain
|
||||
if domain_deleted_alias.user_id == current_user.id:
|
||||
flash(
|
||||
f"You have deleted this alias before. You can restore it on "
|
||||
f"{custom_domain.domain} 'Deleted Alias' page",
|
||||
"error",
|
||||
)
|
||||
else:
|
||||
# should never happen as user can only choose their domains
|
||||
LOG.e(
|
||||
"Deleted Alias %s does not belong to user %s",
|
||||
domain_deleted_alias,
|
||||
)
|
||||
flash(
|
||||
f"You have deleted this alias before. You can restore it on "
|
||||
f"{custom_domain.domain} 'Deleted Alias' page",
|
||||
"error",
|
||||
)
|
||||
|
||||
elif DeletedAlias.get_by(email=full_alias):
|
||||
flash(general_error_msg, "error")
|
||||
|
|
|
@ -170,7 +170,8 @@ class MailSender:
|
|||
LOG.e(
|
||||
f"Could not send message to smtp server {config.POSTFIX_SERVER}:{config.POSTFIX_PORT}"
|
||||
)
|
||||
self._save_request_to_unsent_dir(send_request)
|
||||
if config.SAVE_UNSENT_DIR:
|
||||
self._save_request_to_unsent_dir(send_request)
|
||||
return False
|
||||
|
||||
def _save_request_to_unsent_dir(
|
||||
|
|
Loading…
Reference in a new issue