Track user as target extra when sharing - #1603
Conversation
|
Change this to use model fields directly instead of target_extras |
|
shared_by and shared_from are now added directly to the base target model |
jchate6
left a comment
There was a problem hiding this comment.
This looks good, but would benefit from a test or 2.
Also, I ran into an issue with a
sqlite3.IntegrityError: UNIQUE constraint failed: tom_targets_targetextra.id
When trying to share from TOM1 to TOM2 with a target that had been deleted in TOM2.
Hilariously, the entire stack trace was piped into the error message in TOM1
I don't think this is related to this code, but was hoping you could take a look just in case and either apply a quick fix, or make an issue if you can reproduce it?
|
I can't reproduce this issue. From TOM A, I share target a1. This is what is expected. Are there concrete steps I can take to cause this exception to occur? The error itself is strange because IDs should be assigned automatically, this is some query specifying an ID to save a TargetExtra as, but I can't find any code that would do that. |
|
Those are the steps I used to get that error. It's possible something else is going on? Are you using a postgres or sqlite DB? I'm leaning towards just merging this. If it comes up again we can make an issue. |
Using sqlite for both TOMs
It's pretty hard to see how this PR specifically would cause the issue. Not saying there wasn't something introduced in the larger sharing work that has been done, but this is really piping 2 values over. |
adds a "shared_by" target extra when sharing a target. This is part of item 2 in #1597