Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove subject link to subject set. But keep the subject. #221

Open
denys-potapov opened this issue Jul 27, 2019 · 3 comments
Open

Remove subject link to subject set. But keep the subject. #221

denys-potapov opened this issue Jul 27, 2019 · 3 comments
Assignees

Comments

@denys-potapov
Copy link

I try to move the subject from one subject set to another. Finding and adding the subject to new subject set works:

origin = SubjectSet.find(origin_id)
destination = SubjectSet.find(destination_id)
subject = Subject.find(subject_id)
destination.add(subject)

Now I see subject in both subject sets. But when i try to unlink the subject from origin. It deletes subject, so it's not visible in both subject_sets:

# this deletes subject
origin.remove(subject)

As i understand, removeng link from subject set to subject should not remove the subject itself?

@PmasonFF
Copy link

Checked previous version of panoptes_client 1.03 and reported behavior as above there as well.

Also tried removing redundant .find in above code when referencing a known subject_set.id or subject.id
Also tried to save the destination subject set and/or subject after the .add but this made no difference.

origin.remove(subject) still removed subject from both subject sets, and as far as I can tell subject is deleted (can not be recovered or displayed by subject.id).

I am not sure this is new behaviour or not - I can not recall attempting to move a subject from one subject set where we then removed it from the original subject set.

@adammcmaster
Copy link
Contributor

@camallen Could you weigh in on what the expected behaviour from the API should be? Is the Python client doing something wrong to cause this?

@camallen
Copy link
Contributor

See zooniverse/panoptes#3143

Folks requested the cleanup worker runs when unlinking from sets. Maybe that functionality should check that it's not part of another subject set before removal.

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

No branches or pull requests

4 participants