소스 검색

fix: Give cmd_version a default value in case it is not present

Cristian 5 년 전
부모
커밋
c21af37ed4
2개의 변경된 파일19개의 추가작업 그리고 1개의 파일을 삭제
  1. 18 0
      archivebox/core/migrations/0008_auto_20210104_1458.py
  2. 1 1
      archivebox/core/models.py

+ 18 - 0
archivebox/core/migrations/0008_auto_20210104_1458.py

@@ -0,0 +1,18 @@
+# Generated by Django 3.1.3 on 2021-01-04 14:58
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0007_archiveresult'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='archiveresult',
+            name='cmd_version',
+            field=models.CharField(default='', max_length=32),
+        ),
+    ]

+ 1 - 1
archivebox/core/models.py

@@ -181,7 +181,7 @@ class ArchiveResult(models.Model):
     snapshot = models.ForeignKey(Snapshot, on_delete=models.CASCADE)
     snapshot = models.ForeignKey(Snapshot, on_delete=models.CASCADE)
     cmd = JSONField()
     cmd = JSONField()
     pwd = models.CharField(max_length=256)
     pwd = models.CharField(max_length=256)
-    cmd_version = models.CharField(max_length=32)
+    cmd_version = models.CharField(max_length=32, default="")
     output = models.CharField(max_length=512)
     output = models.CharField(max_length=512)
     start_ts = models.DateTimeField()
     start_ts = models.DateTimeField()
     end_ts = models.DateTimeField()
     end_ts = models.DateTimeField()