From b12a3570b07a4bb6a46840258b1010b7fe463d55 Mon Sep 17 00:00:00 2001 From: Jason Date: Sat, 21 Nov 2020 21:21:31 +0000 Subject: [PATCH] add logging, extend id length --- apiserver/server.py | 1 + apiserver/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apiserver/server.py b/apiserver/server.py index 8b9cae0..585a10d 100644 --- a/apiserver/server.py +++ b/apiserver/server.py @@ -155,6 +155,7 @@ def _add_new_refs(): database.put_ref(ref, nid, source, urlref) logging.info('Added ref ' + ref) except database.IntegrityError: + logging.info('Unable to add ref ' + ref) continue def _update_current_story(item): diff --git a/apiserver/utils.py b/apiserver/utils.py index 9fbe3ee..c2c6d7f 100644 --- a/apiserver/utils.py +++ b/apiserver/utils.py @@ -9,7 +9,7 @@ import string from bleach.sanitizer import Cleaner def gen_rand_id(): - return ''.join(random.choice(string.ascii_uppercase) for _ in range(4)) + return ''.join(random.choice(string.ascii_uppercase) for _ in range(5)) def render_md(md): if md: