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 f11f6bb..75ecf1a 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ