Skip to content

Commit 68b64e0

Browse files
fix CI errors
1 parent 22ba164 commit 68b64e0

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/render/tags.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -658,25 +658,24 @@ impl Render for Tag {
658658
Some(token) => {
659659
let bound_token = token.bind(py);
660660
if bound_token.is_truthy().unwrap_or(false) {
661-
if bound_token.eq("NOTPROVIDED") {
661+
if bound_token.eq("NOTPROVIDED")? {
662662
Cow::Borrowed("")
663663
} else {
664-
let token_str = bound_token.str()?;
665664
Cow::Owned(format!(
666665
r#"<input type="hidden" name="csrfmiddlewaretoken" value="{}">"#,
667-
html_escape::encode_quoted_attribute(&token_str)
666+
html_escape::encode_quoted_attribute(bound_token.str()?.to_str()?)
668667
))
669668
}
670669
} else {
671670
Cow::Borrowed("")
672671
}
673672
}
674673
None => {
675-
let debug = py
676-
.import("django.conf")?
677-
.getattr("settings")?
678-
.getattr("DEBUG")?
679-
.is_truthy()?;
674+
let debug = py
675+
.import("django.conf")?
676+
.getattr("settings")?
677+
.getattr("DEBUG")?
678+
.is_truthy()?;
680679

681680
if debug {
682681
py.import("warnings")?.call_method1(

0 commit comments

Comments
 (0)