[odrs-web] Generate user_skey from the response app_id, harder



commit 8c6364903b7ef6c59f1250494f97d20ddb297639
Author: Richard Hughes <richard hughsie com>
Date:   Wed Mar 16 16:23:53 2022 +0000

    Generate user_skey from the response app_id, harder
    
    We need to use the request user_hash, not the review user_hash.

 app_data/odrs/views_api.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/app_data/odrs/views_api.py b/app_data/odrs/views_api.py
index 90e1c51..002e284 100644
--- a/app_data/odrs/views_api.py
+++ b/app_data/odrs/views_api.py
@@ -263,7 +263,7 @@ def api_fetch():
         # return all results
         item_new = review.asdict(request_item['user_hash'])
         item_new['score'] = _get_review_score(review, request_item)
-        item_new['user_skey'] = _get_user_key(item_new['user_hash'], item_new['app_id'])
+        item_new['user_skey'] = _get_user_key(request_item['user_hash'], item_new['app_id'])
 
         # the UI can hide the vote buttons on reviews already voted on
         if _vote_exists(review.review_id, user.user_id):
@@ -277,7 +277,7 @@ def api_fetch():
         item_new['score'] = 0
         item_new['app_id'] = request_item['app_id']
         item_new['user_hash'] = request_item['user_hash']
-        item_new['user_skey'] = _get_user_key(item_new['user_hash'], item_new['app_id'])
+        item_new['user_skey'] = _get_user_key(request_item['user_hash'], item_new['app_id'])
         items_new.append(item_new)
 
     # sort and cut to limit


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]