Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add meta-review to gamification #190
Add meta-review to gamification #190
Changes from all commits
b505d96
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely wrong. I checked the output you print out https://pastebin.com/6X6y5Kfx. You have the illusion that this works, because your test is wrong. In your test, both participant and reaction share the same id (primary_key), which gives you the wrong belief that you are correct.
That's why I said you should run
.ci/build.sh
and show the log to prove this works. You can use that for debugging, but you don't need to prove anymore as I am pretty confident now this is wrong.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@li-boxuan Thanks for your valuable input.
Can you please tell me what do I need to do in order to fix this? This thing is taking way much more time than I expected to. 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First you need to fix the test case. See #190 (comment) so that your test won't pass (which is good coz now you know your code is wrong).
Then read the definition of
Reaction
model. Understand the relationships between those models.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to test things, I used my user handle
shikharvaish28
. Ideally, I should be able to getreaction
usingid
which is the primary key ofReaction
model.Instead, I am getting
DoesNotExist: Reaction matching query does not exist.
Can you please tell me why is it so?Since
login
is the primary key ofParticipant
, I am expecting it to be linked in someway toid
ofReaction
. I want to do this because if I am somehow able to get the corresponding participant forReaction
, everything would be sorted.PS: I'm running these commands in django shell to get a gist of things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your assumption is wrong. Django does not work like that.
I strongly recommend you to read https://docs.djangoproject.com/en/2.1/topics/db/queries/, esepecially understand how Foreign Key works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary.
meta_review_participant.objects.create(login='test2')
will return the instance.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this is definitely inappropriate and prone to error. You are creating a reaction with id also equals to
test2
, but the participant you created is also with idtest2
.