summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/web_logging/web_utm_source.py
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2024-02-29 15:50:27 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2024-02-29 15:50:27 +0700
commitad665c8c43ce77f27f1832f68cbfff6c328cbad0 (patch)
treef782772be9dcd0f3395f63106cdcb7f5fbdb01d9 /indoteknik_custom/models/web_logging/web_utm_source.py
parent0b5b43646b92298dddcdb7eec1a590d90cadd1e8 (diff)
Fix web.utm.source on find_or_create_key
Diffstat (limited to 'indoteknik_custom/models/web_logging/web_utm_source.py')
-rw-r--r--indoteknik_custom/models/web_logging/web_utm_source.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/indoteknik_custom/models/web_logging/web_utm_source.py b/indoteknik_custom/models/web_logging/web_utm_source.py
index baeb0e9b..08b1e514 100644
--- a/indoteknik_custom/models/web_logging/web_utm_source.py
+++ b/indoteknik_custom/models/web_logging/web_utm_source.py
@@ -5,11 +5,11 @@ class UserActivityLog(models.Model):
_name = 'web.utm.source'
name = fields.Char(string='Name')
- key = fields.Char(string='Key', unique=True)
+ key = fields.Char(string='Key')
def find_or_create_key(self, key):
utm_source = self.search([('key', '=', key)], limit=1)
- if not utm_source:
+ if not utm_source and key:
utm_source = self.create({
'name': key,
'key': key