SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 341c200e authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Fix unable to add already exisiting unreg.author to publication

parent 87f07bbf
No related branches found
No related tags found
No related merge requests found
...@@ -147,12 +147,12 @@ class Publication(models.Model): ...@@ -147,12 +147,12 @@ class Publication(models.Model):
# Authors # Authors
authors = models.ManyToManyField('scipost.Contributor', blank=True, authors = models.ManyToManyField('scipost.Contributor', blank=True,
related_name='publications') related_name='publications')
authors_unregistered = models.ManyToManyField(UnregisteredAuthor, blank=True, authors_unregistered = models.ManyToManyField('journals.UnregisteredAuthor', blank=True,
related_name='publications') related_name='publications')
first_author = models.ForeignKey('scipost.Contributor', blank=True, null=True, first_author = models.ForeignKey('scipost.Contributor', blank=True, null=True,
on_delete=models.CASCADE, on_delete=models.CASCADE,
related_name='first_author_publications') related_name='first_author_publications')
first_author_unregistered = models.ForeignKey(UnregisteredAuthor, blank=True, null=True, first_author_unregistered = models.ForeignKey('journals.UnregisteredAuthor', blank=True, null=True,
on_delete=models.CASCADE, on_delete=models.CASCADE,
related_name='first_author_publications') related_name='first_author_publications')
authors_claims = models.ManyToManyField('scipost.Contributor', blank=True, authors_claims = models.ManyToManyField('scipost.Contributor', blank=True,
......
...@@ -403,7 +403,7 @@ def add_author(request, publication_id, contributor_id=None, unregistered_author ...@@ -403,7 +403,7 @@ def add_author(request, publication_id, contributor_id=None, unregistered_author
def add_unregistered_author(request, publication_id, unregistered_author_id): def add_unregistered_author(request, publication_id, unregistered_author_id):
publication = get_object_or_404(Publication, id=publication_id) publication = get_object_or_404(Publication, id=publication_id)
unregistered_author = get_object_or_404(UnregisteredAuthor, id=unregistered_author_id) unregistered_author = get_object_or_404(UnregisteredAuthor, id=unregistered_author_id)
publication.unregistered_authors.add(unregistered_author) publication.authors_unregistered.add(unregistered_author)
publication.save() publication.save()
return redirect(reverse('journals:manage_metadata', return redirect(reverse('journals:manage_metadata',
kwargs={'doi_label': publication.doi_label})) kwargs={'doi_label': publication.doi_label}))
......
urls0.py 0 → 100644
from django.conf.urls import url
from submissions.constants import SUBMISSIONS_COMPLETE_REGEX
from . import views
urlpatterns = [
# Fellowships
url(r'^fellowships/$', views.fellowships, name='fellowships'),
url(r'^fellowships/add$', views.fellowship_add, name='fellowship_add'),
url(r'^fellowships/(?P<id>[0-9]+)/$', views.fellowship_detail, name='fellowship'),
url(r'^fellowships/(?P<id>[0-9]+)/edit$', views.fellowship_edit, name='fellowship_edit'),
url(r'^fellowships/(?P<id>[0-9]+)/terminate$', views.fellowship_terminate,
name='fellowship_terminate'),
url(r'^fellowships/submissions/{regex}/$'.format(
regex=SUBMISSIONS_COMPLETE_REGEX), views.submission_pool,
name='submission'),
url(r'^fellowships/submissions/{regex}/voting$'.format(
regex=SUBMISSIONS_COMPLETE_REGEX), views.submission_voting_fellows,
name='submission_voting_fellows'),
url(r'^fellowships/submissions/{regex}/add$'.format(
regex=SUBMISSIONS_COMPLETE_REGEX), views.submission_add_fellowship,
name='submission_add_fellowship'),
url(r'^fellowships/submissions/{regex}/voting/add$'.format(
regex=SUBMISSIONS_COMPLETE_REGEX), views.submission_add_fellowship_voting,
name='submission_add_fellowship_voting'),
url(r'^fellowships/(?P<id>[0-9]+)/submissions/{regex}/remove$'.format(
regex=SUBMISSIONS_COMPLETE_REGEX), views.fellowship_remove_submission_voting,
name='fellowship_remove_submission_voting'),
url(r'^fellowships/(?P<id>[0-9]+)/submissions/{regex}/remove$'.format(
regex=SUBMISSIONS_COMPLETE_REGEX), views.fellowship_remove_submission,
name='fellowship_remove_submission'),
url(r'^fellowships/(?P<id>[0-9]+)/submissions/add$',
views.fellowship_add_submission, name='fellowship_add_submission'),
url(r'^fellowships/(?P<id>[0-9]+)/proceedings/add$',
views.fellowship_add_proceedings, name='fellowship_add_proceedings'),
url(r'^fellowships/(?P<id>[0-9]+)/proceedings/(?P<proceedings_id>[0-9]+)/remove$',
views.fellowship_remove_proceedings, name='fellowship_remove_proceedings'),
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment