Eg3-git / wad2project

0 stars 0 forks source link

Delete functionality #24

Closed Tnick0 closed 3 years ago

Tnick0 commented 3 years ago

I've just realised that we're not allowing users to delete their own movies and comments. I believe that it is important to add this, and it shouldn't be that time consuming to implement. One way this could be done is by creating two new views, delete_movie and delete_comment. The first one takes as a parameter the slug of the movie and if the user making the request is the owner, it deletes the movie and redirects him to the index page.

The second view should be similar to the first one. The parameter that should be used to identify comments could be their IDs (primary key assigned by the database).

Please let me know what you think. I'm fine with implementing this myself but if you guys are interested that's fine too.

FilipVyrostko commented 3 years ago

Ok will do

Tnick0 commented 3 years ago

Thanks. I'll do the templates part because I'm currently working on them. When the views are ready let me know so I can add the appropriate buttons and links.

FilipVyrostko commented 3 years ago

This could also be good opportunity to have some java script ask user if they really want to delete movie/comment

Tnick0 commented 3 years ago

That's a great idea. I'll have a go.

FilipVyrostko commented 3 years ago

Views have been added

FilipVyrostko commented 3 years ago

I have realized I forgot to include comment_id as parameter for the function. I will fix it now and add it.