From 8629868432af19f843f026e7d0da7e8e20d02825 Mon Sep 17 00:00:00 2001 From: Ernest W Durbin III Date: Fri, 1 Nov 2019 12:05:19 -0400 Subject: [PATCH 1/2] Jobs: Make URL field required, per @bwaliszewski --- jobs/migrations/0020_auto_20191101_1601.py | 18 ++++++++++++++++++ jobs/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 jobs/migrations/0020_auto_20191101_1601.py diff --git a/jobs/migrations/0020_auto_20191101_1601.py b/jobs/migrations/0020_auto_20191101_1601.py new file mode 100644 index 000000000..d6c9c26e9 --- /dev/null +++ b/jobs/migrations/0020_auto_20191101_1601.py @@ -0,0 +1,18 @@ +# Generated by Django 2.0.13 on 2019-11-01 16:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('jobs', '0019_job_submitted_by'), + ] + + operations = [ + migrations.AlterField( + model_name='job', + name='url', + field=models.URLField(null=True, verbose_name='URL'), + ), + ] diff --git a/jobs/models.py b/jobs/models.py index 9e26d76a1..2041417fa 100644 --- a/jobs/models.py +++ b/jobs/models.py @@ -109,7 +109,7 @@ class Job(ContentManageable): url = models.URLField( verbose_name='URL', null=True, - blank=True) + blank=False) submitted_by = models.ForeignKey( User, From d549e6b6b7a39739cb5d19fb3914e2dbe3f2c666 Mon Sep 17 00:00:00 2001 From: Ernest W Durbin III Date: Fri, 1 Nov 2019 12:11:39 -0400 Subject: [PATCH 2/2] Jobs: add required parameter to test for jobs submission form --- jobs/tests/test_views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jobs/tests/test_views.py b/jobs/tests/test_views.py index 0f087eb42..d9e0b60ff 100644 --- a/jobs/tests/test_views.py +++ b/jobs/tests/test_views.py @@ -301,7 +301,8 @@ def test_job_create(self): 'country': 'USA', 'description': 'Lorem ipsum dolor sit amet', 'requirements': 'Some requirements', - 'email': 'hr@company.com' + 'email': 'hr@company.com', + 'url': 'https://jobs.company.com', } # Check that anonymous posting is not allowed. See #852.