diff --git a/authentication/admin.py b/authentication/admin.py index f6d1871..45463db 100644 --- a/authentication/admin.py +++ b/authentication/admin.py @@ -23,6 +23,7 @@ class ProfileAdmin(admin.ModelAdmin): class WalletAdmin(admin.ModelAdmin): list_display = ["pk", "wallet_type", "user_profile"] + autocomplete_fields = ["user_profile"] search_fields = [ "user_profile__initial_context_id", "wallet_type", @@ -34,6 +35,7 @@ class WalletAdmin(admin.ModelAdmin): class BrightIDConnectionAdmin(admin.ModelAdmin): list_display = ["pk", "user_profile", "context_id", "age"] + autocomplete_fields = ["user_profile"] search_fields = [ "context_id", ] @@ -42,21 +44,25 @@ class BrightIDConnectionAdmin(admin.ModelAdmin): class GitcoinPassportConnectionAdmin(admin.ModelAdmin): list_display = ["pk", "user_profile", "user_wallet_address"] search_fields = ["user_wallet_address", "user_profile__username"] + autocomplete_fields = ["user_profile"] class TwitterConnectionAdmin(admin.ModelAdmin): list_display = ["pk", "user_profile", "oauth_token"] search_fields = ["user_profile__username", "oauth_token"] + autocomplete_fields = ["user_profile"] class EnsConnectionAdmin(admin.ModelAdmin): list_display = ["pk", "user_profile", "user_wallet_address"] search_fields = ["user_profile__username", "user_wallet_address"] + autocomplete_fields = ["user_profile"] class FarcasterConnectionAdmin(admin.ModelAdmin): list_display = ["pk", "user_profile", "user_wallet_address"] search_fields = ["user_profile__username", "user_wallet_address"] + autocomplete_fields = ["user_profile"] admin.site.register(Wallet, WalletAdmin) diff --git a/authentication/tests.py b/authentication/tests.py index f5e5779..35db4e4 100644 --- a/authentication/tests.py +++ b/authentication/tests.py @@ -677,12 +677,13 @@ def test_api_verify_login_signature_with_deleted_wallet(self): class TestGitcoinPassportThirdPartyConnection(APITestCase): def setUp(self) -> None: - self.address = "0x0cE49AF5d8c5A70Edacd7115084B2b3041fE4fF6" + self.address = "0x05204E317D25eb172115546297b056965bE2C74d" self.user_profile = create_new_user() create_new_wallet( user_profile=self.user_profile, _address=self.address, wallet_type="EVM" ) + @patch("authentication.models.submit_passport", lambda a, b: True) def test_gitcoin_passport_connection_successful(self): self.client.force_authenticate(user=self.user_profile.user) response = self.client.post( @@ -697,6 +698,7 @@ def test_gitcoin_passport_connection_successful(self): 1, ) + @patch("authentication.models.submit_passport", lambda a, b: True) def test_gitcoin_passport_not_exists(self): address_does_not_have_gitcoin_passport = ( "0x0cE49AF5d8c5A70Edacd7115084B2b3041fE4fF5" @@ -713,6 +715,7 @@ def test_gitcoin_passport_not_exists(self): ) self.assertEqual(response.status_code, HTTP_400_BAD_REQUEST) + @patch("authentication.models.submit_passport", lambda a, b: True) def test_address_not_owned_by_user(self): self.client.force_authenticate(user=self.user_profile.user) response = self.client.post( diff --git a/core/tests.py b/core/tests.py index 79c9447..3d2d8e4 100644 --- a/core/tests.py +++ b/core/tests.py @@ -316,7 +316,7 @@ def test_EAS_attest_constraints(self): class TestGitcoinPassportConstraint(BaseTestCase): def setUp(self): super().setUp() - self.address = "0x0cE49AF5d8c5A70Edacd7115084B2b3041fE4fF6" + self.address = "0x05204E317D25eb172115546297b056965bE2C74d" self.user_profile = self.user_profile create_new_wallet( user_profile=self.user_profile, _address=self.address, wallet_type="EVM" diff --git a/prizetap/admin.py b/prizetap/admin.py index f32a74d..c8579c0 100644 --- a/prizetap/admin.py +++ b/prizetap/admin.py @@ -7,9 +7,10 @@ class RaffleAdmin(admin.ModelAdmin): list_display = ["pk", "name", "creator_name", "status"] readonly_fields = ["vrf_tx_hash"] + autocomplete_fields = ["creator_profile"] -class RaffleŁEntryAdmin(admin.ModelAdmin): +class RaffleEntryAdmin(admin.ModelAdmin): list_display = [ "pk", "raffle", @@ -24,6 +25,6 @@ class LineaRaffleEntriesAdmin(admin.ModelAdmin): admin.site.register(Raffle, RaffleAdmin) -admin.site.register(RaffleEntry, RaffleŁEntryAdmin) +admin.site.register(RaffleEntry, RaffleEntryAdmin) admin.site.register(Constraint, UserConstraintBaseAdmin) admin.site.register(LineaRaffleEntries, LineaRaffleEntriesAdmin) diff --git a/tokenTap/admin.py b/tokenTap/admin.py index b43bed5..803d176 100644 --- a/tokenTap/admin.py +++ b/tokenTap/admin.py @@ -36,6 +36,7 @@ class TokenDistributionClaimAdmin(admin.ModelAdmin): ] search_fields = ["user_wallet_address"] list_filter = ["token_distribution", "status"] + autocomplete_fields = ["user_profile"] class GlobalSettingsAdmin(admin.ModelAdmin): diff --git a/tokenTap/validators.py b/tokenTap/validators.py index 8870880..7d4d10d 100644 --- a/tokenTap/validators.py +++ b/tokenTap/validators.py @@ -52,7 +52,7 @@ def __init__( def check_user_permissions(self, raise_exception=True): try: - param_values = json.loads(self.td.constraint_params) + param_values = json.loads(self.td.constraint_params or "{}") except Exception as e: logging.error("Error parsing constraint params", e) param_values = {}