-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
1346 create recap pray and pay #4386
1346 create recap pray and pay #4386
Conversation
At least two issues right now before this is ready for review.
Would appreciate @mlissner's thoughts. |
adding needed import for type hints
for more information, see https://pre-commit.ci
The var can go in misc.py or in project/prayers.py. I think the former is better until we have three or more settings for it. There are whole books on your second question, but I think I'd fakers to make a user and some prayers, and then I'd make some little tests to make sure my functions are working properly. This barely needs tests, I agree, but you could check that the ranking is right and that people properly run out of prayers. You could also use time machine to play with the 24 hour timer? |
…-anne/courtlistener into 1346-create-recap-pray-and-pay
for more information, see https://pre-commit.ci
fixing environmental variable
Does this require me to be able to run the Docker container and everything else locally? I had issues with it the last time I tried so it might take me some time to manage it. |
You could rely on Github actions to run the tests, if you want. Might be slow to iterate, but I suppose it'd work. |
…-anne/courtlistener into 1346-create-recap-pray-and-pay
for more information, see https://pre-commit.ci
@mlissner I'm attempting to create some dummy data with Faker. I'm running into some issues, however. The code I just pushed was an attempt to create data for the Prayer model, which is dependent on there being data in the RECAPDocument model. I ran EDIT: disregard this for now, I think I figured out my issue. |
I'm going to confess error, @mlissner. Not sure how to solve the issue above. |
@v-anne, sorry to leave you hanging. @albertisfu, do you think you could find a minute to help Vijay get their tests working? |
(Just FYI, Vijay, Alberto has a few other things in his queue before this one, sorry!) |
No worries, Mike. In the interest of time, I will try to work on the front end so it can be included in this PR too. |
for more information, see https://pre-commit.ci
Just pushed a rough front end, I'm going to hold off on making any substantial changes to any of this until @albertisfu has a chance to weigh in. I think this PR is 85% of the way there, if Alberto can identify what the issues are with the fakers for the Prayer and RECAPDocument models, I'll be able to fully test and then have a finalized PR. |
…-anne/courtlistener into 1346-create-recap-pray-and-pay
for more information, see https://pre-commit.ci
Started discussion #4459 |
@mlissner @v-anne I've applied the following changes:
I'm wondering which fields we need to display here and if a link to PACER is required? I have a question: Is it possible for a user to pray for the same Is there anything else I can help with? |
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 looks good to me with a few little things.
Thanks Alberto for your work and review! Your comments all sounds great.
Is it possible for a user to pray for the same RECAPDocument multiple times? Or should there be only one prayer per user per document? If it's the latter, we might need to add a unique constraint to the model and tweak the prayer_eligible method.
Good point. Yes, we'll want to do that.
I'm wondering which fields we need to display here and if a link to PACER is required?
We've got a lot of work to do on that, but I think we can launch it as an MVP now, right?
for more information, see https://pre-commit.ci
…-anne/courtlistener into 1346-create-recap-pray-and-pay
for more information, see https://pre-commit.ci
Alberto, thank you so much for your work on this. My responses are below.
I think this is alright for this PR. It will need some changes but this PR currently doesn't allow users to actually add prayers from the front end yet, so it's ok if it's not perfect.
I agree with Mike. It was not my attention to allow that. Accordingly, I added a constraint to the
I think the last thing needed before this PR can be merged is to figure out why the test suite is failing after the migration is applied. Again, thank you for revising the issues with my code. |
Looking good! It looks like you're missing the migration file and that's why tests are failing. |
I think it's good to go now. |
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.
@v-anne I reviewed your changes. They look good. I just made a small tweak to the create_prayer
method to simplify it and added a related test.
I also added the SQL migration file for the unique constraint migration.
Finally, I have a question about whether the open_prayers
view should be private or not.
Thanks!
@mlissner If there are no more comments from your side, I think this could be merged. It will require applying the migration on prod. |
Merged! Thank you both! I'll get it deployed in a moment, over here: https://github.com/freelawproject/courtlistener/actions/runs/11002188561 |
We're in business! https://www.courtlistener.com/prayers/top/ |
I mean, sort of! |
This pull request implements the backend for #1346, the RECAP pray and pay project. It incorporates a few functions that (1) enforce the quota for users for maximum document requests each day, (2) that add document requests to the Prayer model, and (3) then update document requests after they are satisfied.
This is a work in progress and is just part of the MVP. Other features such as email notifications will come later.