Send meaningful error on invalid cancel attempt

Phillip Davis created

invalid: adj., 1) not registered

Change summary

lib/admin_actions/cancel.rb | 1 +
1 file changed, 1 insertion(+)

Detailed changes

lib/admin_actions/cancel.rb 🔗

@@ -6,6 +6,7 @@ class AdminAction
 			m = Blather::Stanza::Message.new
 			m.from = CONFIG[:notify_from]
 			m.body = "Your JMP account has been cancelled."
+			raise "Customer not registered" unless customer.registered?
 			customer.stanza_to(m).then {
 				EMPromise.all([
 					Churnbuster.new.cancellation(customer),