Skip to content

Commit

Permalink
Use SPACE and EMPTY constants instead of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoazza committed Jan 7, 2022
1 parent edb8bce commit 6204701
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion djangae/contrib/search/query.py
Expand Up @@ -2,6 +2,8 @@

from .constants import (
STOP_WORDS,
SPACE,
EMPTY,
)

from .models import (
Expand Down Expand Up @@ -107,7 +109,7 @@ def finalize_token(token):
continue

# Split on punctuation, remove double-spaces
content = [x.replace(" ", "") for x in tokenize_content(content)]
content = [x.replace(SPACE, EMPTY) for x in tokenize_content(content)]

if len(content) == 1:
# Do nothing, this was a single token
Expand Down

0 comments on commit 6204701

Please sign in to comment.