From 6b645d07ed712dc3e9b75887fe840030dd8e5eb9 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sat, 6 Jun 2020 07:37:50 +0200 Subject: [PATCH] Fix reverted Service model --- core/models/services.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/models/services.py b/core/models/services.py index 6dac85f..df18286 100644 --- a/core/models/services.py +++ b/core/models/services.py @@ -14,17 +14,17 @@ class Service(Model): name = CharField(max_length=255) description = TextField(null=True, blank=True) - handler_module = CharField(max_length=255, null=True, blank=True) + service_type = CharField(max_length=255, null=True, blank=True) product_groups = ManyToManyField(ProductGroup) @property def handler(self): - if self.handler_module: + if self.service_type: try: - handler_module = import_module(self.handler_module) - return handler_module.ProductRouter(self.id) + service_type = import_module(self.service_type) + return service_type.ServiceRouter(self) except Exception as e: - logger.error(f"Could not load product handler {self.handler_module} for product {self.id}: {e}") + logger.error(f"Could not load product handler {self.service_type} for product {self.id}: {e}") return None class ServicePlan(Model):