Skip to content

Commit

Permalink
fix: issue of pdf generation
Browse files Browse the repository at this point in the history
  • Loading branch information
macloux-dd committed Jun 23, 2023
1 parent 7fd0b65 commit 25d3454
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
Expand Up @@ -17,5 +17,5 @@ def test_get(self):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Content-Type'], 'application/zip')
self.assertEqual(response.headers['Content-Disposition'], 'attachment; filename="GLACE_2018-John_Smith.zip"')
self.assertGreaterEqual(int(response.headers['Content-Length']), 76650)
self.assertGreaterEqual(int(response.headers['Content-Length']), 97000)
self.assertTrue(response.content.startswith(b'PK'))
Expand Up @@ -19,4 +19,4 @@ def test_get_ok(self):
self.assertEqual(response.status_code, 200)
self.assertTrue(response['content-disposition'].endswith('.zip"'))
self.assertTrue(response['content-disposition'].startswith('attachment; filename="'))
self.assertGreaterEqual(int(response['content-length']), 76650)
self.assertGreaterEqual(int(response['content-length']), 97000)
23 changes: 12 additions & 11 deletions ProjectApplication/project_core/urls.py
Expand Up @@ -31,32 +31,33 @@
path(f'{settings.ADMIN_URL}jsi18n/',
JavaScriptCatalog.as_view(),
name='javascript-jsi18n'),

path('applicant/calls-list/',
external.call.CallList.as_view(),
name='call-list'),

path('applicant/proposal/add/',
external.proposal.ProposalView.as_view(),
name='proposal-add'),
path('applicant/proposal/<uuid:uuid>/update/',
external.proposal.ProposalView.as_view(),
name='proposal-update'),
path('applicant/proposal/<uuid:uuid>/',
path('proposal/<uuid:uuid>/',
external.proposal.ProposalDetailView.as_view(),
name='proposal-detail'),
path('applicant/proposal/<uuid:uuid>/pdf',
common.proposal_pdf.ProposalDetailViewPdf.as_view(),
name='proposal-detail-pdf'),
path('applicant/proposal/<uuid:uuid>/zip',
common.proposal_zip.ProposalDetailViewZip.as_view(),
name='proposal-detail-zip'),
path('applicant/proposal/thank-you/<uuid:uuid>/',
path('proposal/thank-you/<uuid:uuid>/',
external.proposal.ProposalThankYouView.as_view(),
name='proposal-thank-you'),
path('applicant/proposal/cannot-modify/',
external.proposal.ProposalCannotModify.as_view(),
name='proposal-cannot-modify'),
path('applicant/proposal/question_answer/file/<int:proposal_qa_file_id>/<str:md5>/',

path('proposal/<uuid:uuid>/pdf',
common.proposal_pdf.ProposalDetailViewPdf.as_view(),
name='proposal-detail-pdf'),
path('proposal/<uuid:uuid>/zip',
common.proposal_zip.ProposalDetailViewZip.as_view(),
name='proposal-detail-zip'),
path('proposal/question_answer/file/<int:proposal_qa_file_id>/<str:md5>/',
common.proposal.ProposalQuestionAnswerFileView.as_view(),
name='proposal-question-answer-file'),

Expand Down Expand Up @@ -281,7 +282,7 @@
template_name='registration/register.tmpl',
form_class=external.user_creation.UserCreationForm,
success_url='/logged/calls-list/'
),
),
name='register'
),

Expand Down
9 changes: 8 additions & 1 deletion nginx-staging/nginx.conf
Expand Up @@ -28,7 +28,14 @@ http {
proxy_redirect off;
}
# Remove basic auth for proposal access
location /proposal/ {
location /applicant/proposal/ {
proxy_pass http://project-application:8085;

proxy_set_header Host $http_host;
proxy_redirect off;
}
# Remove basic auth for proposal access
location /applicant/proposal/ {
proxy_pass http://project-application:8085;

proxy_set_header Host $http_host;
Expand Down

0 comments on commit 25d3454

Please sign in to comment.