Skip to content

Conversation

@tompollard
Copy link
Member

As discussed in #1324, we would like to add an upload agreement as part of the project submission process.

This pull request adds a new "Upload Agreement" step to the project submission workflow. The submitting author must agree to our terms and complete one or more checkboxes. It is not possible to upload files until this step is complete.

The screenshot below shows this new step in the submission process:

Screenshot 2025-08-28 at 11 22 23 PM

@tompollard tompollard requested a review from Chrystinne August 29, 2025 03:26
@tompollard tompollard force-pushed the tp/upload_agreement branch 2 times, most recently from 9a9c19f to 5fe7921 Compare August 29, 2025 03:37
@tompollard tompollard force-pushed the tp/upload_agreement branch from 5fe7921 to ad30545 Compare August 29, 2025 03:39
@tompollard tompollard force-pushed the tp/upload_agreement branch from d014d94 to 58739bc Compare August 29, 2025 03:53
@tompollard tompollard requested a review from bemoody August 29, 2025 16:00
@tompollard
Copy link
Member Author

@bemoody please could you take a look at this if you have the opportunity?

@bemoody
Copy link
Collaborator

bemoody commented Sep 2, 2025

Haven't tested this yet.

I think that if a project is reassigned to a different submitting author, the new author should have to fill out the form again. Could be done by deleting the agreement upon reassignment or by recording the user who signed it.

I think maybe we also want to require the form to be completed before submitting, as well as before uploading files.

@tompollard tompollard force-pushed the tp/upload_agreement branch 4 times, most recently from 367f807 to 390d15b Compare September 2, 2025 19:20
@bemoody
Copy link
Collaborator

bemoody commented Sep 3, 2025

Instead of 390d15b, please just add an UploadAgreement to demo-project.json.

@tompollard
Copy link
Member Author

Instead of 390d15b, please just add an UploadAgreement to demo-project.json.

Done!

agreement.human_subjects_deidentified = self.cleaned_data['human_subjects_deidentified']
agreement.accepted = True
if self.user:
agreement.accepted_by = self.user
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what this is for. How is this different than just calling super().save(commit=False) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, updated to use your suggested syntax.

@bemoody
Copy link
Collaborator

bemoody commented Sep 4, 2025

Your help string says "Each project can have one active upload agreement." But that doesn't appear to be the case.

If there is one UploadAgreement per project, there should be a OneToOneField (or a ForeignKey having unique=True.)

If there is one UploadAgreement per project and accepted_by, there should be a unique_together.

Copy link
Collaborator

@bemoody bemoody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not want to permit multiple UploadAgreements for the same author and the same project. A good way to do that would be to remove project and accepted_by, and replace them with a single foreign key linking to project.Author and having unique=True.

get_active_agreement is full of debugging code that should be unnecessary. I would get rid of this method entirely. Possibly add a method to Author that returns the author's UploadAgreement. You do not need to do project.authors.get(is_submitting=True) to obtain the submitting author, just call project.submitting_author().

Currently it looks like this will forbid editors from copyediting a project if the submitting author has not accepted the agreement. We don't want that.

Non-submitting authors should not see the message "You must accept the upload agreement" on the files page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants