File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ def _should_use_dsa(self):
423423
424424 # Check if the device is using stock OpenWrt.
425425 openwrt_match = re .search (
426- '[oO][pP][eE][nN][wW][rR][tT]\s*([\d.]+)' , self .device .os
426+ r '[oO][pP][eE][nN][wW][rR][tT]\s*([\d.]+)' , self .device .os
427427 )
428428 if openwrt_match :
429429 if version .parse (openwrt_match .group (1 )) >= version .parse ('21' ):
Original file line number Diff line number Diff line change 22from django .utils .translation import gettext_lazy as _
33
44key_validator = RegexValidator (
5- _lazy_re_compile ('^[^\s/\.]+$' ),
5+ _lazy_re_compile (r '^[^\s/\.]+$' ),
66 message = _ ('Key must not contain spaces, dots or slashes.' ),
77 code = 'invalid' ,
88)
1616
1717# device name must either be a hostname or a valid mac address
1818hostname_regex = (
19- '^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}'
20- '[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9]'
21- '[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$'
19+ r '^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}'
20+ r '[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9]'
21+ r '[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$'
2222)
2323device_name_validator = RegexValidator (
2424 _lazy_re_compile ('{0}|{1}' .format (hostname_regex , mac_address_regex )),
Original file line number Diff line number Diff line change 6565 'type' : 'string' ,
6666 'minLength' : 6 ,
6767 'maxLength' : 30 ,
68- 'pattern' : '[\S]' ,
68+ 'pattern' : r '[\S]' ,
6969 }
7070 },
7171 },
You can’t perform that action at this time.
0 commit comments