Skip to content

Commit

Permalink
Merge pull request #510 from hyanwong/image-adding
Browse files Browse the repository at this point in the history
Hack round silly web2py bug
  • Loading branch information
hyanwong committed Feb 6, 2022
2 parents 1addda7 + 6bcd8cc commit 7f1e193
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion controllers/default.py
Expand Up @@ -1076,7 +1076,9 @@ def donor_list():
donor_rows = []
max_groupby = 75 # The max number of sponsorships per username
for r in db(
((db.reservations.user_donor_hide == None) | (db.reservations.user_donor_hide == False)) &
# We can't do user_donor_hide == False as this is converted to IS NULL by web2py
# (bug?), so we do user_donor_hide != True
((db.reservations.user_donor_hide == None) | (db.reservations.user_donor_hide != True)) &
(db.reservations.verified_time != None) &
(db.reservations.username != None)
).select(
Expand Down
6 changes: 4 additions & 2 deletions modules/usernames.py
Expand Up @@ -115,8 +115,10 @@ def donor_name_for_username(username, include_hidden=False):
else:
query = (
(db.reservations.username == username)
# Need to check both False (0) and None (NULL) in SQL
& ((db.reservations.user_donor_hide == False) | (db.reservations.user_donor_hide == None))
# Need to check both False (0) and None (NULL) in SQL. Note we can't do
# user_donor_hide == False as this is converted to IS NULL by web2py
# (bug?), so we do user_donor_hide != True
& ((db.reservations.user_donor_hide == None) | (db.reservations.user_donor_hide != True))
)
for r in db(query).select(
db.reservations.verified_donor_title,
Expand Down

0 comments on commit 7f1e193

Please sign in to comment.