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

Various #2273

Merged
merged 2 commits into from
Sep 3, 2023
Merged

Various #2273

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions liberapay/models/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

def refetch_repos():
# Note: the rate_limiting table is used to avoid blocking on errors
repo = website.db.one("""
repos = website.db.all("""
WITH repo AS (
SELECT r.*
FROM repositories r
Expand All @@ -87,11 +87,12 @@
AND platform = (SELECT repo.platform FROM repo)
RETURNING participant, platform
""")
if not repo:
if not repos:
return

participant = Participant.from_id(repo.participant)
accounts = participant.get_accounts_elsewhere(repo.platform)
participant_id, platform = repos[-1]
participant = Participant.from_id(participant_id)
accounts = participant.get_accounts_elsewhere(platform)

Check warning on line 95 in liberapay/models/repository.py

View check run for this annotation

Codecov / codecov/patch

liberapay/models/repository.py#L93-L95

Added lines #L93 - L95 were not covered by tests
if not accounts:
return
for account in accounts:
Expand Down
2 changes: 1 addition & 1 deletion www/explore/individuals.spt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[---]

per_page = 18
current_page = request.qs.get_int('page', default=1, minimum=1)
current_page = request.qs.get_int('page', default=1, minimum=1, maximum=100)
individuals = website.db.all("""
SELECT p
, ( SELECT s.content
Expand Down
2 changes: 1 addition & 1 deletion www/explore/organizations.spt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[---]

per_page = 18
current_page = request.qs.get_int('page', default=1, minimum=1)
current_page = request.qs.get_int('page', default=1, minimum=1, maximum=100)
organizations = website.db.all("""
SELECT p
, ( SELECT s.content
Expand Down
2 changes: 1 addition & 1 deletion www/explore/pledges.spt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[---]

per_page = 18
current_page = request.qs.get_int('page', default=1, minimum=1)
current_page = request.qs.get_int('page', default=1, minimum=1, maximum=100)
pledgees = website.db.all("""
SELECT (e, p)::elsewhere_with_participant
FROM participants p
Expand Down
2 changes: 1 addition & 1 deletion www/explore/repositories.spt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[---]

per_page = 20
current_page = request.qs.get_int('page', default=1, minimum=1)
current_page = request.qs.get_int('page', default=1, minimum=1, maximum=100)
repos = website.db.all("""
SELECT r, p
FROM repositories r
Expand Down
2 changes: 1 addition & 1 deletion www/explore/teams.spt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[---]

per_page = 18
current_page = request.qs.get_int('page', default=1, minimum=1)
current_page = request.qs.get_int('page', default=1, minimum=1, maximum=100)
teams = website.db.all("""
SELECT p AS participant
, t.*
Expand Down