From 25b74a61d309903eaf248b89a59f667590af03af Mon Sep 17 00:00:00 2001 From: Th3NiKo Date: Sat, 18 Jan 2020 19:02:50 +0100 Subject: [PATCH] BES-6 Fix bug with adding notes and bug connected with showing wrong title --- bestnotes/templates/add.html | 2 +- bestnotes/templates/base.html | 4 +--- bestnotes/urls.py | 3 +-- bestnotes/views.py | 2 +- db.sqlite3 | Bin 192512 -> 192512 bytes 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/bestnotes/templates/add.html b/bestnotes/templates/add.html index 825e76a..08bc796 100644 --- a/bestnotes/templates/add.html +++ b/bestnotes/templates/add.html @@ -6,7 +6,7 @@ {% block content %} {% include 'navbar.html' %} -
{% csrf_token %} +{% csrf_token %}
{% render_field form.name class="form-control mb-2 mt-4 bg-dark text-light" id="name" placeholder="Wpisz nazwe notatki" %} {% render_field form.subject class="form-control mb-2 bg-dark text-light" name="subject" id="subject" placeholder="Wpisz przedmiot" %} diff --git a/bestnotes/templates/base.html b/bestnotes/templates/base.html index 2c5c69d..5c1b8de 100644 --- a/bestnotes/templates/base.html +++ b/bestnotes/templates/base.html @@ -2,15 +2,13 @@ {% load static %} - {{ form.media }} - - + diff --git a/bestnotes/urls.py b/bestnotes/urls.py index 3d73c72..8d11bec 100644 --- a/bestnotes/urls.py +++ b/bestnotes/urls.py @@ -16,6 +16,5 @@ urlpatterns = [ path('notes/', views.notes_name, name="notes_id"), path('create/', views.create_note, name="create_note"), path('delete_note/', views.delete_note, name="delete_note"), - path('update_note/', views.update_note, name="update_note"), - path('update_note_id/', views.update_note_id, name="update_note_id") + path('update_note/', views.update_note, name="update_note") ] diff --git a/bestnotes/views.py b/bestnotes/views.py index eb37aa4..2eb184e 100644 --- a/bestnotes/views.py +++ b/bestnotes/views.py @@ -59,7 +59,7 @@ def topics_by_subject_id(request,subject_id): topics_under_subject = all_topics.filter(subject__id=subject_id) #get topics under given subject if len(topics_under_subject) > 0: - subject_name = all_topics[0].subject.name # Get note with given id + subject_name = topics_under_subject[0].subject.name # Get note with given id context = { 'subject_name': subject_name, diff --git a/db.sqlite3 b/db.sqlite3 index f11f6bb2524df3c0c1d3c01b4d1392e4569e6a5e..75ecf1a88cca3b7d755be47b32727154c5f9b57f 100644 GIT binary patch delta 491 zcmZp8z}@hGdxA9MoryBejCVFBEQuH4U=v{AJH*?<&B1w!qld?h-H%ORv!lQdR*fcW zE>_
zDyv$A4y3&X^;Y}3l(BJ-mBD)ZceqDq63ii+Y4LzBq{+5hZ~40H{QbPWs@ z49%^K%&m-#^-PV7%?wPMtU1Akq$FjR=VoP=rz9tq73E~)%kpZ#?kOP4WQyR&C2Am-2$s01Iwx|AQT)2Q^Hv|7}{%rni zU^Gl-+`e!jlN6tTvj7K!q^KezV|Z$DNn&xz^b6~ml!btdloT8N;*z5LymUJo{Q|q~ Mj2oE#+cPo%04ewMjWd5MWhab{6wReDkSWP|K~;zkC#28OyuW(r0| zR)%I)CMJ3o<`#ygo4YeA*@f8o{xR??^WWk3;Ge|zkAFLV?q)@U7knxz%)X3-Oy8_j zKVL!62+3SC3j+i5=1cRpUz*Qo6d=UTuff3oi2pEuD}NflJO2`Xjm?4$Lj1~d%#Msk z1~}YhzzLF`ydhI+d+LA2g$p?LGVt%^&*sktdVMnE_Js?Xr1(S`7#syS801A285w<3 oi%SxVQ;dxar=MQWq|9rhUtCg@pO