Skip to content

1586 custom target sharing#1588

Open
Fingel wants to merge 4 commits into
version-3-0-alphafrom
1586-custom-target-sharing
Open

1586 custom target sharing#1588
Fingel wants to merge 4 commits into
version-3-0-alphafrom
1586-custom-target-sharing

Conversation

@Fingel

@Fingel Fingel commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

When sharing, converts custom target model fields to target extras for the destination tom by comparing the custom model ._meta.fields() with the BaseTarget._meta.fields()

Two other fixes:

2279497 Sharing was broken for custom targets to begin with due to mismatched app labels

de44131 fix submit button being placed at the bottom of the screen far away from everything

Fixes #1586

Fingel added 3 commits June 24, 2026 14:03
This appears to have been broken for users that use custom targets. It
only worked for non-custom targets by coincidence - PersistentShare has
the same app label as the default target object. As soon as a custom
target model is used, the app label changes (for example custom_code)
but then the permissions don't match. They need to be
tom_targets.add_persistentshare, for example, not
custom_code.add_persistenceshare.
@Fingel Fingel requested a review from jchate6 June 24, 2026 23:08
@jchate6 jchate6 moved this to Needs Review in TOM Toolkit Jun 25, 2026

@jchate6 jchate6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

testing this, I'm getting a "POST /api/targets/ HTTP/1.1" 400 64 in the receiving TOM, and ERROR: Returned Response code 400 with content: b'{"targetextra_set":[{"value":["Not a valid string."]},{},{},{}]}' as an error message in my sending TOM that has a custom Target.
I have several additional fields in my extended target model.
Thoughts?

@jchate6 jchate6 linked an issue Jul 1, 2026 that may be closed by this pull request
3 tasks
@Fingel

Fingel commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

I couldn't reproduce this with additional custom fields. Could this be an authentication issue masking the actual sharing? Do you have permissions with the auth key you are using for the user on Tom B?

In any case, I added a string cast to the target extra value, though it should work with values of other types.

@jchate6

jchate6 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

ok, I'll try to figure out what' going on.

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

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

How does TOM-TOM sharing behave with custom Target models?

2 participants