Backpatch validators into initial migration
authorMagnus Hagander <magnus@hagander.net>
Wed, 21 Mar 2018 13:15:27 +0000 (14:15 +0100)
committerMagnus Hagander <magnus@hagander.net>
Wed, 21 Mar 2018 13:16:22 +0000 (14:16 +0100)
It's just silly to do a real migration with this

pgweb/core/migrations/0001_initial.py

index d164c666a404d41d66068a759c4ece8ddb9acc82..44238103fca6c97695574d0890b02225aee118e4 100644 (file)
@@ -4,6 +4,7 @@ from __future__ import unicode_literals
 from django.db import migrations, models
 from django.conf import settings
 
+import pgweb.core.models
 
 class Migration(migrations.Migration):
 
@@ -100,7 +101,7 @@ class Migration(migrations.Migration):
             name='UserProfile',
             fields=[
                 ('user', models.OneToOneField(primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
-                ('sshkey', models.TextField(help_text=b'Paste one or more public keys in OpenSSH format, one per line.', verbose_name=b'SSH key', blank=True)),
+                ('sshkey', models.TextField(help_text=b'Paste one or more public keys in OpenSSH format, one per line.', verbose_name=b'SSH key', blank=True, validators=[pgweb.core.models.validate_sshkey])),
                 ('lastmodified', models.DateTimeField(auto_now=True)),
             ],
         ),