Commit 069a3683 authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

Fix update tags functional

parent 37306fd4
Subproject commit a50a79e678e04e9fc35bc3dc668acc81570d9075 Subproject commit 5a0d58c6b23acaea15224ba0091134fc71bf82f7
...@@ -38,7 +38,9 @@ class NewsUpdater: ...@@ -38,7 +38,9 @@ class NewsUpdater:
try: try:
text = self.load_text(i[1]) text = self.load_text(i[1])
tags = self.get_tags(text) tags = self.get_tags(text)
self.update_news('update wp_esi_news_accept set tags_id="%s" where id=%s', (tags, i[0])) if len(tags) == 0:
tags = None
self.update_news('update wp_esi_news_accept set tags_id=%s where id=%s', (tags, i[0]))
print('News id={} was updated'.format(i[0])) print('News id={} was updated'.format(i[0]))
except BaseException as e: except BaseException as e:
print(e.with_traceback()) print(e.with_traceback())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment