diff --git a/SocialHelper/homepage/__pycache__/views.cpython-37.pyc b/SocialHelper/homepage/__pycache__/views.cpython-37.pyc index 52cc4f9..f5f6c4f 100644 Binary files a/SocialHelper/homepage/__pycache__/views.cpython-37.pyc and b/SocialHelper/homepage/__pycache__/views.cpython-37.pyc differ diff --git a/SocialHelper/homepage/views.py b/SocialHelper/homepage/views.py index 49d74c8..761e14a 100644 --- a/SocialHelper/homepage/views.py +++ b/SocialHelper/homepage/views.py @@ -86,7 +86,10 @@ def Dodawanie(request): script_local = request.POST['script'] title_local = request.POST['title'] data_local = timezone.now() - pic_local = request.FILES['file'] + if request.FILES: + pic_local = request.FILES['file'] + else: + pic_local = "/images/basic.png" offer_local = request.POST['offer'] product = Product( picture = pic_local, diff --git a/SocialHelper/media/images/basic.png b/SocialHelper/media/images/basic.png new file mode 100644 index 0000000..e036575 Binary files /dev/null and b/SocialHelper/media/images/basic.png differ