wojtekidd / djangoapp-koszulki

Python bootcamp project - T-shirts portal
https://djangoapp-koszulki.herokuapp.com/
0 stars 3 forks source link

Connect T-shirt to User/profile #29

Open wojtekidd opened 4 years ago

KarolinaWojciechowska commented 4 years ago

Features to make:

  1. You can create a post only when logged in connected to #37 
  2. You can only update/delete your posts, not others posts
wojtekidd commented 4 years ago

Starting here

wojtekidd commented 4 years ago

Working on this in #40

KarolinaWojciechowska commented 4 years ago

Override form_valid method in app views.py. Set the instance of an author to currently logged in user.

Eg.: class CreateTshirtView(CreateView): def form_valid(self, form): form.instance.author = self.request.user return super().form_valid(form)