From d3a69c2e9308bbc0176b896377143a7daa1d3d60 Mon Sep 17 00:00:00 2001 From: Uxio Fuentefria Date: Mon, 9 Oct 2023 14:16:01 +0200 Subject: [PATCH] Update admin page for Master Copies - Allow `initial_block_number` to be set on the admin page - Set `Safe` as the default deployer --- safe_transaction_service/history/admin.py | 1 - .../0076_alter_safemastercopy_deployer.py | 17 +++++++++++++++++ safe_transaction_service/history/models.py | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 safe_transaction_service/history/migrations/0076_alter_safemastercopy_deployer.py diff --git a/safe_transaction_service/history/admin.py b/safe_transaction_service/history/admin.py index eb76cd580..af44c609a 100644 --- a/safe_transaction_service/history/admin.py +++ b/safe_transaction_service/history/admin.py @@ -452,7 +452,6 @@ def tx_hash(self, o: ModuleTransaction): class MonitoredAddressAdmin(BinarySearchAdmin): actions = ["reindex", "reindex_last_day", "reindex_last_week", "reindex_last_month"] list_display = ("address", "initial_block_number", "tx_block_number") - readonly_fields = ["initial_block_number"] search_fields = ["=address"] @admin.action(description="Reindex from initial block") diff --git a/safe_transaction_service/history/migrations/0076_alter_safemastercopy_deployer.py b/safe_transaction_service/history/migrations/0076_alter_safemastercopy_deployer.py new file mode 100644 index 000000000..e463107d4 --- /dev/null +++ b/safe_transaction_service/history/migrations/0076_alter_safemastercopy_deployer.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.5 on 2023-10-09 12:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("history", "0075_multisigtransaction_proposer"), + ] + + operations = [ + migrations.AlterField( + model_name="safemastercopy", + name="deployer", + field=models.CharField(default="Safe", max_length=50), + ), + ] diff --git a/safe_transaction_service/history/models.py b/safe_transaction_service/history/models.py index a80d22859..bcc3f748c 100644 --- a/safe_transaction_service/history/models.py +++ b/safe_transaction_service/history/models.py @@ -1606,7 +1606,7 @@ def relevant(self): class SafeMasterCopy(MonitoredAddress): objects = SafeMasterCopyManager.from_queryset(SafeMasterCopyQueryset)() version = models.CharField(max_length=20, validators=[validate_version]) - deployer = models.CharField(max_length=50, default="Gnosis") + deployer = models.CharField(max_length=50, default="Safe") l2 = models.BooleanField(default=False) class Meta: