Skip to content
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

4845 pray-and-pray revisions pt. 4 #4956

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

v-anne
Copy link
Contributor

@v-anne v-anne commented Jan 23, 2025

Making further revisions to the pray-and-pay feature, as outlined in #4845.

Changes include:

  • Adding pagination to the community leaderboard
  • Breaking the user prayers page into two tables, one of pending requests and one of granted ones
  • Buttons on the leaderboard (help, your prayers, sign up for the email reminders)
  • Button for mailing list on help page

@v-anne
Copy link
Contributor Author

v-anne commented Jan 24, 2025

@mlissner I'm getting tripped up by some tests that may be flaky. I didn't touch disclosures but their tests started failing now.

@mlissner
Copy link
Member

There's a flaky test for some reason. It'll get fixed shortly, you can ignore. If that's all there is holding this up, let me know and we'll review anyway.

@v-anne
Copy link
Contributor Author

v-anne commented Jan 24, 2025

This PR may be ready. I say "may" because I'm having issues rebuilding the docker containers after tailwind was added, so I can't actually see what the frontend looks like. That being said, no germane tests failed earlier, so I suspect nothing is seriously broken with these changes.

@ERosendo
Copy link
Contributor

because I'm having issues rebuilding the docker containers after tailwind was added, so I can't actually see what the frontend looks like.

Hey @v-anne!, could you please describe the error messages or unexpected behavior you're encountering when trying to build the docker containers? Have you tried running docker compose up -d --build?

@v-anne
Copy link
Contributor Author

v-anne commented Jan 24, 2025

@ERosendo, there aren't any error messages per se, but the containers are hanging indefinitely at various stages.

For example, this was pending for almost 25 minutes:

cl-postgres | 2025-01-24 16:31:23.842 UTC [22] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.003 s, sync=0.002 s, total=0.011 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB

I suspect it may be because of my computer's age (5 years old), but I'm not completely sure.

@mlissner
Copy link
Member

That sort of sounds like it's just the last log line, and nothing had to be printed. Is it actually stuck?

@v-anne
Copy link
Contributor Author

v-anne commented Jan 26, 2025

That sort of sounds like it's just the last log line, and nothing had to be printed. Is it actually stuck?

The script proceeded past that step but tripped up at other places. I quit the operation multiple times after it took 5+ hours without finishing.

A few weeks ago everything ran on this same computer in less than 20 minutes. Did something significant change?

If you want, you can review this PR now. I can't promise that the front end is 100% functioning.

@v-anne v-anne marked this pull request as ready for review January 26, 2025 02:28
@mlissner
Copy link
Member

Sorry @v-anne, I think this didn't get assigned to somebody properly, so it got a bit stuck. I just put Eduardo on it, so it's on his list now, but he has some high priority work that will have to come first. But now we're on track at least!

@v-anne
Copy link
Contributor Author

v-anne commented Feb 2, 2025

I ultimately got Docker to work, but it wasn't pretty. I deleted the codebase and the containers from my machine, cloned the repo again, and then set up the containers afresh.

@v-anne
Copy link
Contributor Author

v-anne commented Feb 2, 2025

Getting this strange error in relation to the pagination on the community leaderboard. Not quite sure how to fix it.

The buttons for the pagination show up fine, but when I try clicking them this shows up:

Environment:


Request Method: GET
Request URL: http://0.0.0.0:8000/prayers/top/?page=2

Django Version: 5.1.5
Python Version: 3.13.1
Installed Applications:
['daphne',
 'pghistory.admin',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.contenttypes',
 'django.contrib.auth',
 'django.contrib.humanize',
 'django.contrib.messages',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.sitemaps',
 'django.contrib.staticfiles',
 'corsheaders',
 'hcaptcha',
 'markdown_deux',
 'mathfilters',
 'rest_framework',
 'rest_framework.authtoken',
 'django_filters',
 'storages',
 'waffle',
 'admin_cursor_paginator',
 'django_elasticsearch_dsl',
 'pghistory',
 'pgtrigger',
 'cl.alerts',
 'cl.audio',
 'cl.api',
 'cl.citations',
 'cl.corpus_importer',
 'cl.custom_filters',
 'cl.disclosures',
 'cl.donate',
 'cl.favorites',
 'cl.people_db',
 'cl.lasc',
 'cl.lib',
 'cl.opinion_page',
 'cl.recap',
 'cl.recap_rss',
 'cl.scrapers',
 'cl.search',
 'cl.simple_pages',
 'cl.stats',
 'cl.users',
 'cl.visualizations',
 'tailwind',
 'django_extensions',
 'django_browser_reload',
 'debug_toolbar']
Installed Middleware:
['django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'django_permissions_policy.PermissionsPolicyMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 'csp.middleware.CSPMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django_ratelimit.middleware.RatelimitMiddleware',
 'waffle.middleware.WaffleMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'cl.lib.middleware.RobotsHeaderMiddleware',
 'cl.lib.middleware.IncrementalNewTemplateMiddleware',
 'pghistory.middleware.HistoryMiddleware',
 'django_browser_reload.middleware.BrowserReloadMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware']



Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/django/core/handlers/exception.py", line 42, in inner
    response = await get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/django/core/handlers/base.py", line 271, in _get_response_async
    response = await middleware_method(request, response)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/courtlistener/cl/lib/middleware.py", line 86, in process_template_response
    old_template = response.template_name
                   ^^^^^^^^^^^^^^^^^^^^^^

Exception Type: AttributeError at /prayers/top/
Exception Value: 'TemplateResponse' object has no attribute 'template_name'

@mlissner
Copy link
Member

mlissner commented Feb 3, 2025

I opened a fresh issue for this. It's related to a new middleware we're using as part of the redesign, but I don't know why it'd cause you trouble. #5034

@v-anne
Copy link
Contributor Author

v-anne commented Feb 6, 2025

Once this PR is approved, I think the feature may be ready to launch.

@mlissner
Copy link
Member

mlissner commented Feb 6, 2025

One thing I think I haven't seen is this item from the list:

We still need to teach people what the emojis mean and how to find the prayer leader board. One thought is that the first time somebody prays for something, we could pop up a modal congratulates them on their first prayer and then tells them about the leaderboard, how it all works, and points them to the help page.

Did I miss that or are you thinking launch before that's done? I fear that doing so would put zillions of prayer hands around without explaining what they mean or providing a link to the top prayers page or help page.

@v-anne
Copy link
Contributor Author

v-anne commented Feb 6, 2025

I'm working on it and hope to include it in this PR as well (depending on timing).

@mlissner
Copy link
Member

mlissner commented Feb 6, 2025

OOOOh, exciting. We're still suffering the yoke of a client thing, but should be wrapping that up this week. Sorry!

@v-anne
Copy link
Contributor Author

v-anne commented Feb 6, 2025

All good.

What I'm thinking of doing is instead of checking whether it's the first request a user has ever made, a modal explaining how the feature works will pop up by default and the user will be able to check a box to make it go away permanently.

@mlissner
Copy link
Member

mlissner commented Feb 6, 2025

Just using a cookie? Seems fine to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Do
Development

Successfully merging this pull request may close these issues.

3 participants