File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -658,25 +658,24 @@ impl Render for Tag {
658
658
Some ( token) => {
659
659
let bound_token = token. bind ( py) ;
660
660
if bound_token. is_truthy ( ) . unwrap_or ( false ) {
661
- if bound_token. eq ( "NOTPROVIDED" ) {
661
+ if bound_token. eq ( "NOTPROVIDED" ) ? {
662
662
Cow :: Borrowed ( "" )
663
663
} else {
664
- let token_str = bound_token. str ( ) ?;
665
664
Cow :: Owned ( format ! (
666
665
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 ( ) ? )
668
667
) )
669
668
}
670
669
} else {
671
670
Cow :: Borrowed ( "" )
672
671
}
673
672
}
674
673
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 ( ) ?;
680
679
681
680
if debug {
682
681
py. import ( "warnings" ) ?. call_method1 (
You can’t perform that action at this time.
0 commit comments