Draft: Make sure extensions always have a user #54

Merged
Francesco Siddi merged 1 commits from dfelinto/extensions-website:fix-no-orphans into main 2024-03-14 18:36:06 +01:00

When submitting a file the created extension gets a user right away.
This makes sure there are no orphans extensions.

The extension is then incomplete until the draft is saved once (which
means finalizing the extension upload process, by adding a description
and thumbnails).

Any attempt to edit or submit a new extension will lead the user to the
editing draft page.

Note: We could add a new option to [x] Send for Review. The front-end
even has a half-baked code for that. But should be tackled separately.


Patch notes:

  • Originally when trying to finish an upload as a different user we woudl get a 403, now we get a 404.
When submitting a file the created extension gets a user right away. This makes sure there are no orphans extensions. The extension is then incomplete until the draft is saved once (which means finalizing the extension upload process, by adding a description and thumbnails). Any attempt to edit or submit a new extension will lead the user to the editing draft page. Note: We could add a new option to [x] Send for Review. The front-end even has a half-baked code for that. But should be tackled separately. ------------ Patch notes: * Originally when trying to finish an upload as a different user we woudl get a 403, now we get a 404.
Dalai Felinto requested review from Francesco Siddi 2024-03-11 18:55:13 +01:00
Author
Owner

The current approach tries to return the SubmitFileView view when editing an incomplete extension. It is not working (403).

I think the best course of action is:

  • Split the submit view in two:
    • SubmitFileView (has self.file).
    • EditDraftView (has pk for the extension).
    • returns EditDraftView when trying to manage (edit) an incomplete extension
The current approach tries to return the SubmitFileView view when editing an incomplete extension. It is not working (403). I think the best course of action is: * Split the submit view in two: * SubmitFileView (has self.file). * EditDraftView (has pk for the extension). * returns EditDraftView when trying to manage (edit) an incomplete extension
Dalai Felinto force-pushed fix-no-orphans from b95ed0cb98 to baf67fc9c0 2024-03-14 17:20:30 +01:00 Compare
Dalai Felinto changed title from WIP: New Extensions should get a user right away to Draft: Make sure extensions always have a user 2024-03-14 17:21:06 +01:00
Author
Owner

Code should be good now.

I still need to fix unittests though (since some were testing the finalize-submit URL which no longer exists). done

Code should be good now. ~~I still need to fix unittests though (since some were testing the finalize-submit URL which no longer exists).~~ done
Dalai Felinto force-pushed fix-no-orphans from baf67fc9c0 to 489da73683 2024-03-14 17:57:40 +01:00 Compare
Francesco Siddi approved these changes 2024-03-14 18:28:18 +01:00
Francesco Siddi merged commit d00bcc585a into main 2024-03-14 18:36:06 +01:00
Francesco Siddi deleted branch fix-no-orphans 2024-03-14 18:36:06 +01:00
Owner

Just noticed that if I as a maintainer got more than one extension (one a freshly uploaded draft, another already in approval queue, for example), then it's impossible to edit the other extension.
Is this also intentional?
Or should be at least allow editing the already existing extension?

Just noticed that if I as a maintainer got more than one extension (one a freshly uploaded draft, another already in approval queue, for example), then it's impossible to edit the other extension. Is this also intentional? Or should be at least allow editing the already existing extension?

Editing existing extensions should be allowed, regardless of a pending one. The current behavior looks like a bug/limitation.

Editing existing extensions should be allowed, regardless of a pending one. The current behavior looks like a bug/limitation.
Dalai Felinto pinned this 2024-04-27 17:44:08 +02:00
Author
Owner

A bug indeed. The only thing which should be prevented is to upload a new extension while there is a draft still around.

A bug indeed. The only thing which should be prevented is to upload a new extension while there is a draft still around.
Owner

Pushed a fix for this in 725d03589a

Pushed a fix for this in https://projects.blender.org/infrastructure/extensions-website/commit/725d03589ac8d7b90b93917b1353c90173bb4417
Oleg-Komarov unpinned this 2024-05-23 13:29:56 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/extensions-website#54
No description provided.