mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
Improved contact deleting
This commit is contained in:
parent
17f7a609cc
commit
ef90dfc70b
3 changed files with 61 additions and 6 deletions
|
@ -18,12 +18,13 @@ module Epp::ContactsHelper
|
|||
end
|
||||
|
||||
def delete_contact
|
||||
#no deleting, implement PaperTrail or something similar.
|
||||
#TODO check for relation before 'destroying'
|
||||
@contact = find_contact
|
||||
handle_errors(@contact) and return unless @contact
|
||||
@contact.destroy
|
||||
render '/epp/contacts/delete'
|
||||
Contact.transaction do
|
||||
@contact = find_contact
|
||||
handle_errors(@contact) and return unless @contact
|
||||
handle_errors(@contact) and return unless @contact.destroy_and_clean
|
||||
|
||||
render '/epp/contacts/delete'
|
||||
end
|
||||
end
|
||||
|
||||
def check_contact
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue