Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maxime Bombar
Note Kfet 2015 django
Commits
dfc45975
Commit
dfc45975
authored
Mar 22, 2018
by
Antoine Bernard
Browse files
[trez] escape forward slash dans object d'une facture
parent
c1c55e64
Changes
1
Hide whitespace changes
Inline
Side-by-side
note/views.py
View file @
dfc45975
...
...
@@ -2068,7 +2068,7 @@ def render_tex(data, template, supreme = False):
file
=
template
.
rsplit
(
'/'
,
1
)[
-
1
].
rsplit
(
'.'
,
1
)[
0
]
path
=
template
.
rsplit
(
'/'
,
1
)[
0
]
filename
=
[
datetime
.
today
().
date
(),
path
,
data
[
"id_facture"
],
data
[
"objet"
]
]
filename
=
"_"
.
join
([
unicode
(
x
).
upper
()
for
x
in
filename
]).
replace
(
" "
,
"_"
).
replace
(
'"'
,
""
).
replace
(
"'"
,
""
)
+
".pdf"
filename
=
"_"
.
join
([
unicode
(
x
).
upper
()
for
x
in
filename
]).
replace
(
" "
,
"_"
).
replace
(
'"'
,
""
).
replace
(
"'"
,
""
)
.
replace
(
"/"
,
"_"
)
+
".pdf"
try
:
body
=
render_to_string
(
template
,
data
).
encode
(
"utf-8"
)
except
TemplateDoesNotExist
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment