Skip to content

Commit

Permalink
remove sponsorship
Browse files Browse the repository at this point in the history
  • Loading branch information
mekarpeles authored Oct 22, 2024
1 parent bd2f887 commit 90d508e
Show file tree
Hide file tree
Showing 20 changed files with 4 additions and 948 deletions.
6 changes: 0 additions & 6 deletions conf/openlibrary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ internal_tests_api_key: 8oPd1tx747YH374ohs48ZO5s2Nt1r9yD
ia_availability_api_v2_url: https://archive.org/services/availability/
ia_base_url: https://archive.org

ia_civicrm_api:
url: http://web:8080/internal/fake/civicrm
api_key: XXX
site_key: XXX
auth: XXX

sentry:
enabled: false
# Dummy endpoint; where sentry logs are sent to
Expand Down
108 changes: 0 additions & 108 deletions openlibrary/core/civicrm.py

This file was deleted.

4 changes: 1 addition & 3 deletions openlibrary/core/lending.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def __init__(self, message="Access to this item is temporarily locked."):
config_ia_ol_metadata_write_s3 = None
config_ia_users_loan_history = None
config_ia_loan_api_developer_key = None
config_ia_civicrm_api = None
config_http_request_timeout = None
config_loanstatus_url = None
config_bookreader_host = None
Expand All @@ -80,7 +79,7 @@ def setup(config):
global config_ia_availability_api_v2_url, config_ia_ol_metadata_write_s3
global config_ia_xauth_api_url, config_http_request_timeout, config_ia_s3_auth_url
global config_ia_users_loan_history, config_ia_loan_api_developer_key
global config_ia_civicrm_api, config_ia_domain
global config_ia_domain

config_loanstatus_url = config.get('loanstatus_url')
config_bookreader_host = config.get('bookreader_host', 'archive.org')
Expand All @@ -98,7 +97,6 @@ def setup(config):
config_ia_s3_auth_url = config.get('ia_s3_auth_url')
config_ia_users_loan_history = config.get('ia_users_loan_history')
config_ia_loan_api_developer_key = config.get('ia_loan_api_developer_key')
config_ia_civicrm_api = config.get('ia_civicrm_api')
config_internal_tests_api_key = config.get('internal_tests_api_key')
config_http_request_timeout = config.get('http_request_timeout')

Expand Down
26 changes: 1 addition & 25 deletions openlibrary/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,27 +331,6 @@ def ia_metadata(self):
ocaid = self.get('ocaid')
return get_metadata(ocaid) if ocaid else {}

@property # type: ignore[misc]
@cache.method_memoize
def sponsorship_data(self):
was_sponsored = 'openlibraryscanningteam' in self.ia_metadata.get(
'collection', []
)
if not was_sponsored:
return None

donor = self.ia_metadata.get('donor')

return web.storage(
{
'donor': donor,
'donor_account': (
OpenLibraryAccount.get_by_link(donor) if donor else None
),
'donor_msg': self.ia_metadata.get('donor_msg'),
}
)

def get_waitinglist_size(self, ia=False):
"""Returns the number of people on waiting list to borrow this book."""
return waitinglist.get_waitinglist_size(self.key)
Expand Down Expand Up @@ -906,9 +885,6 @@ def is_librarian(self):
def is_super_librarian(self):
return self.is_usergroup_member('/usergroup/super-librarians')

def in_sponsorship_beta(self):
return self.is_usergroup_member('/usergroup/sponsors')

def is_beta_tester(self):
return self.is_usergroup_member('/usergroup/beta-testers')

Expand Down Expand Up @@ -1078,7 +1054,7 @@ class UserGroup(Thing):
@classmethod
def from_key(cls, key: str):
"""
:param str key: e.g. /usergroup/sponsor-waitlist
:param str key: e.g. /usergroup/foo
:rtype: UserGroup | None
"""
if not key.startswith('/usergroup/'):
Expand Down
Loading

0 comments on commit 90d508e

Please sign in to comment.