diff --git a/media/resolution_files/res_con_109b961f-f152-4152-a314-3e5875bb493d.pdf b/media/attendance_files/attendance_4611725c-da7f-4894-be88-dfb9ac233696.pdf similarity index 100% rename from media/resolution_files/res_con_109b961f-f152-4152-a314-3e5875bb493d.pdf rename to media/attendance_files/attendance_4611725c-da7f-4894-be88-dfb9ac233696.pdf diff --git a/media/attendance_files/attendance_da3b8e62-13d3-4511-8277-305d23dc8cb7.pdf b/media/attendance_files/attendance_da3b8e62-13d3-4511-8277-305d23dc8cb7.pdf deleted file mode 100644 index cb89fa9..0000000 Binary files a/media/attendance_files/attendance_da3b8e62-13d3-4511-8277-305d23dc8cb7.pdf and /dev/null differ diff --git a/media/resolution_files/res_con_97df3439-d7b9-4c6e-ba86-f6c41a462600.pdf b/media/resolution_files/res_con_97df3439-d7b9-4c6e-ba86-f6c41a462600.pdf new file mode 100644 index 0000000..ab2f67d Binary files /dev/null and b/media/resolution_files/res_con_97df3439-d7b9-4c6e-ba86-f6c41a462600.pdf differ diff --git a/misdghs/__pycache__/__init__.cpython-313.pyc b/misdghs/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..f72d058 Binary files /dev/null and b/misdghs/__pycache__/__init__.cpython-313.pyc differ diff --git a/misdghs/__pycache__/settings.cpython-313.pyc b/misdghs/__pycache__/settings.cpython-313.pyc new file mode 100644 index 0000000..7a70690 Binary files /dev/null and b/misdghs/__pycache__/settings.cpython-313.pyc differ diff --git a/misdghs/__pycache__/urls.cpython-313.pyc b/misdghs/__pycache__/urls.cpython-313.pyc new file mode 100644 index 0000000..3a76952 Binary files /dev/null and b/misdghs/__pycache__/urls.cpython-313.pyc differ diff --git a/misdghs/__pycache__/wsgi.cpython-313.pyc b/misdghs/__pycache__/wsgi.cpython-313.pyc new file mode 100644 index 0000000..ed0dfc6 Binary files /dev/null and b/misdghs/__pycache__/wsgi.cpython-313.pyc differ diff --git a/resulation/__pycache__/__init__.cpython-313.pyc b/resulation/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..5a21c2a Binary files /dev/null and b/resulation/__pycache__/__init__.cpython-313.pyc differ diff --git a/resulation/__pycache__/admin.cpython-313.pyc b/resulation/__pycache__/admin.cpython-313.pyc new file mode 100644 index 0000000..d408b78 Binary files /dev/null and b/resulation/__pycache__/admin.cpython-313.pyc differ diff --git a/resulation/__pycache__/apps.cpython-313.pyc b/resulation/__pycache__/apps.cpython-313.pyc new file mode 100644 index 0000000..37d9baf Binary files /dev/null and b/resulation/__pycache__/apps.cpython-313.pyc differ diff --git a/resulation/__pycache__/models.cpython-313.pyc b/resulation/__pycache__/models.cpython-313.pyc new file mode 100644 index 0000000..c2f655b Binary files /dev/null and b/resulation/__pycache__/models.cpython-313.pyc differ diff --git a/resulation/__pycache__/urls.cpython-313.pyc b/resulation/__pycache__/urls.cpython-313.pyc new file mode 100644 index 0000000..82a1e54 Binary files /dev/null and b/resulation/__pycache__/urls.cpython-313.pyc differ diff --git a/resulation/__pycache__/views.cpython-313.pyc b/resulation/__pycache__/views.cpython-313.pyc new file mode 100644 index 0000000..c9dda43 Binary files /dev/null and b/resulation/__pycache__/views.cpython-313.pyc differ diff --git a/resulation/migrations/__pycache__/0001_initial.cpython-313.pyc b/resulation/migrations/__pycache__/0001_initial.cpython-313.pyc new file mode 100644 index 0000000..ed3a5c9 Binary files /dev/null and b/resulation/migrations/__pycache__/0001_initial.cpython-313.pyc differ diff --git a/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-313.pyc b/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-313.pyc new file mode 100644 index 0000000..8e4dfe5 Binary files /dev/null and b/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-313.pyc differ diff --git a/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-313.pyc b/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-313.pyc new file mode 100644 index 0000000..7bd8632 Binary files /dev/null and b/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-313.pyc differ diff --git a/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-313.pyc b/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-313.pyc new file mode 100644 index 0000000..1c16717 Binary files /dev/null and b/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-313.pyc differ diff --git a/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-313.pyc b/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-313.pyc new file mode 100644 index 0000000..414d835 Binary files /dev/null and b/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-313.pyc differ diff --git a/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-313.pyc b/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-313.pyc new file mode 100644 index 0000000..2f28b34 Binary files /dev/null and b/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-313.pyc differ diff --git a/resulation/migrations/__pycache__/0007_alter_resulation_m_venue_alter_resulation_tittle.cpython-313.pyc b/resulation/migrations/__pycache__/0007_alter_resulation_m_venue_alter_resulation_tittle.cpython-313.pyc new file mode 100644 index 0000000..060da52 Binary files /dev/null and b/resulation/migrations/__pycache__/0007_alter_resulation_m_venue_alter_resulation_tittle.cpython-313.pyc differ diff --git a/resulation/migrations/__pycache__/0008_alter_resulation_attendance_file_and_more.cpython-313.pyc b/resulation/migrations/__pycache__/0008_alter_resulation_attendance_file_and_more.cpython-313.pyc new file mode 100644 index 0000000..5e54d4b Binary files /dev/null and b/resulation/migrations/__pycache__/0008_alter_resulation_attendance_file_and_more.cpython-313.pyc differ diff --git a/resulation/migrations/__pycache__/0009_alter_resulation_attendance_file_and_more.cpython-313.pyc b/resulation/migrations/__pycache__/0009_alter_resulation_attendance_file_and_more.cpython-313.pyc new file mode 100644 index 0000000..2071431 Binary files /dev/null and b/resulation/migrations/__pycache__/0009_alter_resulation_attendance_file_and_more.cpython-313.pyc differ diff --git a/resulation/migrations/__pycache__/__init__.cpython-313.pyc b/resulation/migrations/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..118804f Binary files /dev/null and b/resulation/migrations/__pycache__/__init__.cpython-313.pyc differ diff --git a/resulation/urls.py b/resulation/urls.py index fa552d6..544d0a5 100644 --- a/resulation/urls.py +++ b/resulation/urls.py @@ -13,8 +13,7 @@ urlpatterns = [ path('viewresulation/', resulation.views.Viewresulation, name='viewresulation'), path('deed/', resulation.views.Contract, name='deed'), path('mou/', resulation.views.Mou, name='mou'), - re_path('downloads//', resulation.views.file_download, name='file-download'), - path('rcm/downloads//', resulation.views.file_download, name='file-download'), + path('/', resulation.views.file_download, name='file-download'), path('rcm/', resulation.views.file_download, name='download_file'), ] diff --git a/resulation/views.py b/resulation/views.py index 1af1115..aad930e 100644 --- a/resulation/views.py +++ b/resulation/views.py @@ -77,9 +77,13 @@ def Viewresulation(request): return render(request, 'resulation/viewresulation.html', {'pdf_records': pdf_records}) -def file_download(request, attendance_id, filename): +def file_download(request, type, filename): # Construct the full path to the file - file_path = os.path.join(settings.MEDIA_ROOT, 'attendance_files', filename) + if type== 'attendance': + file_path = os.path.join(settings.MEDIA_ROOT, 'attendance_files', filename) + if type=='resolution': + file_path = os.path.join(settings.MEDIA_ROOT, 'resolution_files', filename) + # Use sendfile to stream the file directly return FileResponse(open(file_path, 'rb'), content_type='application/pdf') diff --git a/templates/resulation/viewresulation.html b/templates/resulation/viewresulation.html index 6c6525b..3edcf02 100644 --- a/templates/resulation/viewresulation.html +++ b/templates/resulation/viewresulation.html @@ -35,11 +35,11 @@ {{ record.m_date|date:"d M Y" }} {{ record.m_venue }} - Download + Download {% if record.res_con_mou_file %} - Download + Download {% endif %}