mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 12:56:30 +01:00
Revert ac06ff735 since it caused unexpected side effects
This commit is contained in:
parent
330b24a93b
commit
bfec5c3a37
2 changed files with 5 additions and 9 deletions
|
|
@ -627,7 +627,6 @@ def search_prototype(
|
|||
|
||||
if key:
|
||||
# exact or partial match on key
|
||||
key = str(key).strip().lower()
|
||||
exact_match = query.filter(Q(db_key__iexact=key))
|
||||
if not exact_match and fuzzy_matching:
|
||||
# try with partial match instead
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ from collections import defaultdict
|
|||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
|
||||
from evennia.locks.lockfuncs import perm as perm_lockfunc
|
||||
from evennia.utils.utils import make_iter, to_str
|
||||
|
||||
|
|
@ -591,10 +592,8 @@ class TagHandler(object):
|
|||
|
||||
"""
|
||||
ret = []
|
||||
category = category.strip().lower() if category is not None else None
|
||||
for keystr in make_iter(key):
|
||||
# note - the _getcache call removes case sensitivity for us
|
||||
keystr = str(keystr).strip().lower()
|
||||
ret.extend(
|
||||
[
|
||||
tag if return_tagobj else to_str(tag.db_key)
|
||||
|
|
@ -633,7 +632,7 @@ class TagHandler(object):
|
|||
if not (key or key.strip()): # we don't allow empty tags
|
||||
continue
|
||||
tagstr = str(key).strip().lower()
|
||||
category = str(category).strip().lower() if category else category
|
||||
category = category.strip().lower() if category else category
|
||||
|
||||
# This does not delete the tag object itself. Maybe it should do
|
||||
# that when no objects reference the tag anymore (but how to check)?
|
||||
|
|
@ -663,7 +662,7 @@ class TagHandler(object):
|
|||
"tag__db_tagtype": self._tagtype,
|
||||
}
|
||||
if category:
|
||||
query["tag__db_category"] = str(category).strip().lower()
|
||||
query["tag__db_category"] = category.strip().lower()
|
||||
getattr(self.obj, self._m2m_fieldname).through.objects.filter(**query).delete()
|
||||
self._cache = {}
|
||||
self._catcache = {}
|
||||
|
|
@ -728,7 +727,7 @@ class TagHandler(object):
|
|||
keys[tup[1]].append(tup[0])
|
||||
data[tup[1]] = tup[2] # overwrite previous
|
||||
for category, key in keys.items():
|
||||
self.add(key=str(key).strip().lower(), category=category, data=data.get(category, None))
|
||||
self.add(key=key, category=category, data=data.get(category, None))
|
||||
|
||||
def batch_remove(self, *args):
|
||||
"""
|
||||
|
|
@ -749,9 +748,7 @@ class TagHandler(object):
|
|||
elif nlen > 1:
|
||||
keys[tup[1]].append(tup[0])
|
||||
for category, key in keys.items():
|
||||
self.remove(
|
||||
key=str(key).strip().lower(), category=category, data=data.get(category, None)
|
||||
)
|
||||
self.remove(key=key, category=category, data=data.get(category, None))
|
||||
|
||||
def __str__(self):
|
||||
return ",".join(self.all())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue