Commit cae9da19 authored by o's avatar o
Browse files

Merge branch 'fixDeletionOfFwd' into 'master'

prevent purging when deleting fwd of deleted iaddress

See merge request !59
parents 07e1ebf9 a0205f81
Pipeline #9334 passed with stage
in 2 minutes and 53 seconds
...@@ -117,7 +117,7 @@ class IApi < Sinatra::Base ...@@ -117,7 +117,7 @@ class IApi < Sinatra::Base
if email = EmailIaddress.by_email(email) if email = EmailIaddress.by_email(email)
if fwd = email.email_forwards.where(target: target).first if fwd = email.email_forwards.where(target: target).first
fwd.destroy! fwd.destroy!
email.destroy! if email.unused? email.destroy! if email.unused? && !email.deleted?
return json result: 'success' return json result: 'success'
end end
end end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment