diff --git a/physionet-django/console/forms.py b/physionet-django/console/forms.py index 74f86d7923..c1713cde28 100644 --- a/physionet-django/console/forms.py +++ b/physionet-django/console/forms.py @@ -27,6 +27,7 @@ PublishedAffiliation, PublishedAuthor, PublishedProject, + PublishedPublication, exists_project_slug, ) from project.projectfiles import ProjectFiles @@ -705,6 +706,22 @@ def save(self): return contact +class PublishedProjectAddPublication(forms.ModelForm): + class Meta: + model = PublishedPublication + fields = ('citation', 'url') + + def __init__(self, project, *args, **kwargs): + super().__init__(*args, **kwargs) + self.project = project + + def save(self): + publication = super().save(commit=False) + publication.project = self.project + publication.save() + return publication + + class CreateLegacyAuthorForm(forms.ModelForm): """ Create an author for a legacy project. diff --git a/physionet-django/console/templates/console/manage_published_project.html b/physionet-django/console/templates/console/manage_published_project.html index 7b3902ea2e..de933752d6 100644 --- a/physionet-django/console/templates/console/manage_published_project.html +++ b/physionet-django/console/templates/console/manage_published_project.html @@ -49,6 +49,7 @@
Citation: {{ publication.citation }}
+ URL: {{ publication.url }}