def undo_delete_module(request, domain, record_id): record = DeleteModuleRecord.get(record_id) record.undo() messages.success(request, 'Module successfully restored.') return back_to_main(request, domain, app_id=record.app_id, module_id=record.module_id)