Skip to content
Snippets Groups Projects
Commit 2be29a8d authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Merge branch 'dk-custom-op-reblog-fix' into 'develop'

Fix for reblog operation in custom_op

See merge request !19
parents 7e1ed799 cc092d8c
No related branches found
No related tags found
4 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!19Fix for reblog operation in custom_op
...@@ -158,7 +158,7 @@ class CustomOp: ...@@ -158,7 +158,7 @@ class CustomOp:
else: else:
sql = """ sql = """
INSERT INTO hive_reblogs (account, post_id, created_at) INSERT INTO hive_reblogs (account, post_id, created_at)
SELECT ha.name, hp.id, :date SELECT ha.name, hp.id as post_id, :date
FROM hive_accounts ha FROM hive_accounts ha
INNER JOIN hive_posts hp ON hp.author_id = ha.id INNER JOIN hive_posts hp ON hp.author_id = ha.id
INNER JOIN hive_permlink_data hpd ON hpd.id = hp.permlink_id INNER JOIN hive_permlink_data hpd ON hpd.id = hp.permlink_id
...@@ -170,9 +170,12 @@ class CustomOp: ...@@ -170,9 +170,12 @@ class CustomOp:
if not DbState.is_initial_sync(): if not DbState.is_initial_sync():
author_id = Accounts.get_id(author) author_id = Accounts.get_id(author)
blogger_id = Accounts.get_id(blogger) blogger_id = Accounts.get_id(blogger)
result = dict(row) if row is not None:
post_id = result['post_id'] result = dict(row)
FeedCache.insert(post_id, blogger_id, block_date) post_id = result['post_id']
Notify('reblog', src_id=blogger_id, dst_id=author_id, FeedCache.insert(post_id, blogger_id, block_date)
post_id=post_id, when=block_date, Notify('reblog', src_id=blogger_id, dst_id=author_id,
score=Accounts.default_score(blogger)).write() post_id=post_id, when=block_date,
score=Accounts.default_score(blogger)).write()
else:
log.error("Error in reblog: row is None!")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment