jwjacobson / jazztunes

a jazz repertoire management app
https://jazztunes.org
GNU General Public License v3.0
4 stars 1 forks source link

Tunes need to be owned by users (and edit/delete views to add that to retrieval query) #17

Closed bbelderbos closed 11 months ago

bbelderbos commented 11 months ago
          TODO: when a tune can be owned later by somebody, we also need to check here if it's the tune of `request.user`

_Originally posted by @bbelderbos in https://github.com/jwjacobson/jazz_repertoire/pull/13#discussion_r1404076869_

bbelderbos commented 11 months ago

So you can add the owner check to get_object_or_404, something like: get_object_or_404(Model, pk=pk, user=request.user) (the logged in user is always available in the view via request.user)

bbelderbos commented 11 months ago

After https://github.com/jwjacobson/jazz_repertoire/issues/15