diff --git a/indexer_app/utils.py b/indexer_app/utils.py index 19e5ca9..aaf6eb1 100644 --- a/indexer_app/utils.py +++ b/indexer_app/utils.py @@ -406,7 +406,7 @@ async def handle_list_update( logger.info(f"updating list..... {data}") - listObject = await List.objects.filter(on_chain_id=data["id"]).aupdate( + listObject = await List.objects.filter(on_chain_id=data["list_id"]).aupdate( owner_id=data["owner"], default_registration_status=data["default_registration_status"], name=data["name"], diff --git a/pots/serializers.py b/pots/serializers.py index a9f2180..f809f68 100644 --- a/pots/serializers.py +++ b/pots/serializers.py @@ -5,7 +5,7 @@ from base.serializers import TwoDecimalPlacesField from tokens.serializers import SIMPLE_TOKEN_EXAMPLE, TokenSerializer -from .models import Pot, PotApplication, PotFactory, PotPayout +from .models import Pot, PotApplication, PotFactory, PotPayout, PotApplicationReview class PotSerializer(ModelSerializer): @@ -80,7 +80,22 @@ class Meta: whitelisted_deployers = AccountSerializer(many=True) +class ApplicationReviewSerializer(serializers.ModelSerializer): + reviewer = AccountSerializer() + + class Meta: + model = PotApplicationReview + fields = [ + "reviewer", + "notes", + "status", + "reviewed_at", + "tx_hash" + ] + + class PotApplicationSerializer(ModelSerializer): + reviews = ApplicationReviewSerializer(many=True) class Meta: model = PotApplication @@ -93,6 +108,7 @@ class Meta: "submitted_at", "updated_at", "tx_hash", + "reviews", ] pot = PotSerializer() @@ -211,6 +227,14 @@ class PaginatedPotFactoriesResponseSerializer(serializers.Serializer): "results": [SIMPLE_POT_FACTORY_EXAMPLE], } +POT_APPLICATION_REVIEW_EXAMPLE = { + "reviewer": SIMPLE_ACCOUNT_EXAMPLE, + "notes": "Looks good!", + "status": "Approved", + "reviewed_at": "2024-06-05T18:12:39.014Z", + "tx_hash": "EVMQsXorrrxPLHfK9UnbzFUy1SVYWvc8hwSGQZs4RbTk", +} + SIMPLE_POT_APPLICATION_EXAMPLE = { "id": 2, @@ -221,6 +245,7 @@ class PaginatedPotFactoriesResponseSerializer(serializers.Serializer): "tx_hash": "EVMQsXorrrxPLHfK9UnbzFUy1SVYWvc8hwSGQZs4RbTk", "pot": SIMPLE_POT_EXAMPLE, "applicant": SIMPLE_ACCOUNT_EXAMPLE, + "reviews": [POT_APPLICATION_REVIEW_EXAMPLE], } PAGINATED_POT_APPLICATION_EXAMPLE = {