ContriHUB / ContriHub-18

http://contrihubs.herokuapp.com - :snowman: :cyclone: ContriHub is an event under Avishkar-18 where we are expecting to get more and more people involved in Opens Source activities.
7 stars 33 forks source link

Showing bonus or deducted points of verified PRs #124

Closed jarvisdev closed 5 years ago

jarvisdev commented 5 years ago

Changed PRs model and also modified views.py code to update the bonus and deducted points of that PR fixes #118 Update there was a bug in PR #123 that is fixed in this one so please consider that

deepak-bharti-deel commented 5 years ago

reopen pr when requested changes are there :smile:

deepak-bharti-deel commented 5 years ago

Changed PRs model and also modified views.py code to update the bonus and deducted points of that PR fixes #118 Update there was a bug in PR #123 that is fixed in this one so please consider that

what was the bug in #123

jarvisdev commented 5 years ago

Actually I was taking the value of bonus or deducted points from the textfield using javascript but I forgot that as there will be many cards having same id #bonus or #deduct in their textfield I have take the value from the PR for which request is made. Just changed var bonus_pts = $("#bonus").val(); var deduct_pts = $("#deduct").val(); to var bonus_pts = $("#bonus",pr).val(); var deduct_pts = $("#deduct",pr).val();

deepak-bharti-deel commented 5 years ago

Actually I was taking the value of bonus or deducted points from the textfield using javascript but I forgot that as there will be many cards having same id #bonus or #deduct in their textfield I have take the value from the PR for which request is made. Just changed var bonus_pts = $("#bonus").val(); var deduct_pts = $("#deduct").val(); to var bonus_pts = $("#bonus",pr).val(); var deduct_pts = $("#deduct",pr).val();

I couldn't notice that :smile: good catch :+1: actually many elements can have same class but this isn't true in case of id i.e an id can be occupied by a unique element so better use bonus & deduct as class names