-
-
Notifications
You must be signed in to change notification settings - Fork 889
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
Pictrs delete token #5317
Pictrs delete token #5317
Conversation
Co-authored-by: dullbananas <[email protected]>
@dullbananas test_schema_setup is failing with the following error. So the problem is that columns are in the wrong order after running down.sql (which restores the column that was deleted in up.sql). From what I found there is no easy way to change the column order in postgres. What do you think?
Edit: Maybe the solution is to sort these lines in alphabetical order, but not sure how to do that. Ive disabled the test for now. |
#5204 implements a diff checker that ignores changes in column order. For now, instead of disabling the check, it would be better to change the column order in the add_image_upload migration. |
Alright its a bit complicated but I did that now. One thing I noticed is that |
I've had to do this a bunch recently so a tip to avoid all the conflicts due to squash merges to main: Now that #5260 is merged, take this PR, and do
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just these 2 things, and the conflicts.
crates/routes/src/images/delete.rs
Outdated
let pictrs_config = context.settings().pictrs()?; | ||
let url = format!( | ||
"{}image/delete/{}/{}", | ||
pictrs_config.url, &data.token, &data.filename | ||
"{}internal/delete?alias={}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to build this again, you could just the delete_image_from_pictrs
function you made above.
As noted by @Nothing4You there is actually no need to store any pictrs delete tokens. Instead we can use /internal/delete endpoint and allow deletion whenever it is done by the uploader or an admin (or community mod in case of icon/banner). Note that this wont work if the api key isnt set.
Requires #5260