Closed sachintom999 closed 4 months ago
@endalkh should we perhaps merge this as is, or are your suggestions important enough that they should be addressed?
@endalkh should we perhaps merge this as is, or are your suggestions important enough that they should be addressed?
@endalkh - Thanks for the review comments.
@adrianmcphee,
As per our discussion, though adding the field voted_users
is simpler, on further reading, your idea of adding a new model (called IdeaVote
) is more robust and prevents data corruption in certain cases.
I am implementing that approach. All the comments above will be addressed when I push the latest changes.
I will do that in some time.
@adrianmcphee @endalkh , the pipeline is failing because of conflicting migrations
I tried pulling the latest main branch and merging into this feature branch and for me , it says No conflicts detected to merge.
Could you please try at your end and help me here. Thanks
@sachintom999 can you please pull the last changes and run migration merge
'python manage-py nakemigrations --merge'
@endalkh I already did that , but it says No conflicts detected to merge
@endalkh , sorry. My fork was not upto date. Hence the above issues. Fixed all issues now.
Changes
voted_users
inIdea
model to store list of voted users. Removedvote_count
cast_vote_for_idea
and corresponding urlVote
, it checks whether the logged in user is voted or not , then add/remove the user tovoted_users
and update the new count in the frontendTesting
Case : logged in user
Case: user without authentication
@adrianmcphee , I will raise a separate PR for unit tests for the above functionality