diff --git a/submissions/forms.py b/submissions/forms.py index 064a6615d24fe13bafa71f9c95c5970db939e64e..ecce7bf133c5e85cd7cf8ba9482745d4f707f3c8 100644 --- a/submissions/forms.py +++ b/submissions/forms.py @@ -331,7 +331,7 @@ class RequestSubmissionForm(SubmissionChecks, forms.ModelForm): self.fields['proceedings'].empty_label = None if not qs.exists(): # No proceedings issue to submit to, so adapt the form fields - self.fields['submitted_to'].queryset = self.fields['submitted_to'].exclude( + self.fields['submitted_to'].queryset = self.fields['submitted_to'].queryset.exclude( doi_label=SCIPOST_JOURNAL_PHYSICS_PROC) del self.fields['proceedings'] diff --git a/submissions/migrations/0044_auto_20181115_1009.py b/submissions/migrations/0044_auto_20181115_1009.py new file mode 100644 index 0000000000000000000000000000000000000000..7139126d8fb0582482a918c15959c8d1ddf28bc8 --- /dev/null +++ b/submissions/migrations/0044_auto_20181115_1009.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2018-11-15 09:09 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('submissions', '0043_remove_submission_submitted_to_journal'), + ] + + operations = [ + migrations.AlterField( + model_name='submission', + name='submitted_to', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='journals.Journal'), + ), + ] diff --git a/submissions/models.py b/submissions/models.py index ea7c57afca1915791d04126dea38fe0b608c98f1..58acca54932f2fceb81313a167eb661b54918470 100644 --- a/submissions/models.py +++ b/submissions/models.py @@ -90,8 +90,7 @@ class Submission(models.Model): voting_fellows = models.ManyToManyField('colleges.Fellowship', blank=True, related_name='voting_pool') - submitted_to = models.ForeignKey('journals.Journal', on_delete=models.CASCADE, - blank=True, null=True) + submitted_to = models.ForeignKey('journals.Journal', on_delete=models.CASCADE) proceedings = models.ForeignKey('proceedings.Proceedings', null=True, blank=True, related_name='submissions') title = models.CharField(max_length=300) @@ -441,12 +440,13 @@ class EditorialAssignment(SubmissionRelatedObjectMixin, models.Model): # Only send if status is appropriate to prevent double sending return False - EditorialAssignment.objects.filter( - id=self.id).update(date_invited=timezone.now(), status=STATUS_INVITED) - # Send mail mail_sender = DirectMailUtil(mail_code='eic/assignment_request', instance=self) mail_sender.send() + + EditorialAssignment.objects.filter( + id=self.id).update(date_invited=timezone.now(), status=STATUS_INVITED) + return True