From a12e67157346c36f697dd18657bd896e93708f61 Mon Sep 17 00:00:00 2001 From: Benjamin Pereto Date: Sat, 26 Sep 2020 21:49:18 +0200 Subject: [PATCH] FIX: revert --- src/borghive/migrations/0003_repo_mode.py | 2 +- src/borghive/models/repository.py | 1 - src/borghive/tests/test_repo.py | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/borghive/migrations/0003_repo_mode.py b/src/borghive/migrations/0003_repo_mode.py index 67ff4ea..c28dfb9 100644 --- a/src/borghive/migrations/0003_repo_mode.py +++ b/src/borghive/migrations/0003_repo_mode.py @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='repository', name='mode', - field=models.CharField(blank=True, choices=[('BORG', 'Borg'), ('IMPORT', 'Import'), ('EXPORT', 'Export')], default='BORG', max_length=6), + field=models.CharField(choices=[('BORG', 'Borg'), ('IMPORT', 'Import'), ('EXPORT', 'Export')], default='BORG', max_length=6), ), migrations.AlterField( model_name='repository', diff --git a/src/borghive/models/repository.py b/src/borghive/models/repository.py index ddc4b9d..f9d323f 100644 --- a/src/borghive/models/repository.py +++ b/src/borghive/models/repository.py @@ -134,7 +134,6 @@ class Repository(BaseModel): max_length=6, choices=RepositoryMode.CHOICES, default=RepositoryMode.BORG, - blank=True ) repo_user = models.OneToOneField(RepositoryUser, on_delete=models.CASCADE) diff --git a/src/borghive/tests/test_repo.py b/src/borghive/tests/test_repo.py index 7b8149b..7fbc24b 100644 --- a/src/borghive/tests/test_repo.py +++ b/src/borghive/tests/test_repo.py @@ -35,7 +35,8 @@ def test_create_repo(self): data = { 'name': 'testrepo', 'ssh_keys': '2', - 'location': '1' + 'location': '1', + 'mode': 'BORG' } response = self.client.post(reverse('repository-create'), data=data) self.assertEqual(response.status_code, 302)