Fix one more error in alias autocompletion
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
0dd3da5c01
commit
fb98d9cd8b
1 changed files with 1 additions and 1 deletions
|
|
@ -138,7 +138,7 @@ class ConsumerViewSet(ReadOnlyProtectedModelViewSet):
|
||||||
try:
|
try:
|
||||||
re.compile(alias)
|
re.compile(alias)
|
||||||
valid_regex = True
|
valid_regex = True
|
||||||
except re.error:
|
except (re.error, TypeError):
|
||||||
valid_regex = False
|
valid_regex = False
|
||||||
suffix = '__iregex' if valid_regex else '__istartswith'
|
suffix = '__iregex' if valid_regex else '__istartswith'
|
||||||
alias_prefix = '^' if valid_regex else ''
|
alias_prefix = '^' if valid_regex else ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue