less bloat

This commit is contained in:
tonyrewin 2022-07-03 03:56:26 +03:00
parent e69339799e
commit ce3f3339e9
2 changed files with 1 additions and 11 deletions

View File

@ -39,16 +39,11 @@ def migrate(entry, topics_by_oid):
else:
if len(topic.title) > len(topic_dict['title']) or \
len(topic.body) < len(topic_dict['body']):
print('updating topic')
topic.update({
'slug': slug,
'title': topic_dict['title'] if len(topic.title) > len(topic_dict['title']) else topic.title,
'body': topic_dict['body'] if len(topic.body) < len(topic_dict['body']) else topic.body,
#'views': topic.views + topic_dict['views']
#'authors': topic.views + topic_dict['views']
#'followers': topic.views + topic_dict['views']
'body': topic_dict['body'] if len(topic.body) < len(topic_dict['body']) else topic.body
})
print(slug + ': ' + topic.title)
except Exception as e:
print('not found old topic: ' + slug)
else:

View File

@ -39,11 +39,6 @@ def migrate(entry, topics_by_oid):
if not topic:
del topic_dict['oid']
topic = Topic.create(**topic_dict)
else:
print(slug + ': ' + topic.title)
else:
print('not found topic: ' + slug)
raise Exception
except Exception as e:
print(e)
raise e