use user slug as rater in Comment and User ratings

This commit is contained in:
knst-kotov
2022-01-14 15:19:57 +03:00
parent 65fa744ea5
commit 1cc0e3e5df
10 changed files with 17 additions and 33 deletions

View File

@@ -71,14 +71,13 @@ def migrate(entry, shouts_by_oid):
if rater and comment:
comment_rating_dict = {
'value': comment_rating_old['value'],
'createdBy': rater.id,
'createdBy': rater.slug,
'comment_id': comment.id
}
cts = comment_rating_old.get('createdAt')
if cts: comment_rating_dict['createdAt'] = date_parse(cts)
try:
comment_rating = CommentRating.create(**comment_rating_dict)
# comment_rating_dict['id'] = comment_rating.id
comment_dict['ratings'].append(comment_rating_dict)
except Exception as e:
print(comment_rating_dict)