Skip to content

Commit

Permalink
refactor: eliminate single-use helper (#8226)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-richards authored Nov 18, 2024
1 parent b07d4db commit 6608c9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions ietf/doc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,10 +1046,6 @@ def get_replaces_tree(doc):
return sorted(history, key=lambda x: x['published'])


def get_search_cache_key(key_fragment):
return f"doc:document:search:{key_fragment}"


def build_file_urls(doc: Union[Document, DocHistory]):
if doc.type_id == "rfc":
base_path = os.path.join(settings.RFC_PATH, doc.name + ".")
Expand Down
4 changes: 2 additions & 2 deletions ietf/doc/views_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
IESG_BALLOT_ACTIVE_STATES, IESG_STATCHG_CONFLREV_ACTIVE_STATES,
IESG_CHARTER_ACTIVE_STATES )
from ietf.doc.fields import select2_id_doc_name_json
from ietf.doc.utils import get_search_cache_key, augment_events_with_revision, needed_ballot_positions
from ietf.doc.utils import augment_events_with_revision, needed_ballot_positions
from ietf.group.models import Group
from ietf.idindex.index import active_drafts_index_by_group
from ietf.name.models import DocTagName, DocTypeName, StreamName
Expand Down Expand Up @@ -292,7 +292,7 @@ def search(request):
if request.method == "POST":
form = SearchForm(data=request.POST)
if form.is_valid():
cache_key = get_search_cache_key(form.cache_key_fragment())
cache_key = f"doc:document:search:{form.cache_key_fragment()}"
cached_val = cache.get(cache_key)
if cached_val:
[results, meta] = cached_val
Expand Down

0 comments on commit 6608c9d

Please sign in to comment.