From d0bd6c1231e2e460eb7517df72d5a58d97f06c94 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 10 Aug 2023 19:28:04 +1000 Subject: [PATCH] Expand Nostr key field to 64 chars (32 hex bytes) --- users/migrations/0019_auto_20230810_1927.py | 32 +++++++++++++++++++++ users/models.py | 4 +-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 users/migrations/0019_auto_20230810_1927.py diff --git a/users/migrations/0019_auto_20230810_1927.py b/users/migrations/0019_auto_20230810_1927.py new file mode 100644 index 0000000..cdfb658 --- /dev/null +++ b/users/migrations/0019_auto_20230810_1927.py @@ -0,0 +1,32 @@ +# Generated by Django 3.2.20 on 2023-08-10 09:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("users", "0018_auto_20230810_1754"), + ] + + operations = [ + migrations.AlterField( + model_name="user", + name="nostr_key", + field=models.CharField( + blank=True, + help_text="A Nostr public key in 32-byte hex format (64 characters)", + max_length=64, + null=True, + unique=True, + ), + ), + migrations.AlterField( + model_name="user", + name="nostr_relays", + field=models.JSONField( + blank=True, + default=list, + help_text="An array of Nostr relay URLs that this public key posts to", + ), + ), + ] diff --git a/users/models.py b/users/models.py index 8f1f033..787a136 100644 --- a/users/models.py +++ b/users/models.py @@ -82,11 +82,11 @@ class User(ModelMeta, AbstractUser): ) nostr_key = models.CharField( - max_length=32, + max_length=64, unique=True, blank=True, null=True, - help_text="A Nostr public key in 32-byte hex format", + help_text="A Nostr public key in 32-byte hex format (64 characters)", ) nostr_relays = models.JSONField( default=list,