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 {
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 (
You can’t perform that action at this time.
0 commit comments