diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2014-01-06 18:25:11 +0100 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2014-01-06 18:31:37 +0100 |
commit | 85cd657e78f5e07fc914a04e0be3de16ce6d144b (patch) | |
tree | cdbad2c06a074951ec1c10e4fd514292340436fa /hyperkitty/api.py | |
parent | 0cc6889d599742c9dd70bda1d8ea9e6ab45faa26 (diff) | |
download | hyperkitty-85cd657e78f5e07fc914a04e0be3de16ce6d144b.tar.gz hyperkitty-85cd657e78f5e07fc914a04e0be3de16ce6d144b.tar.xz hyperkitty-85cd657e78f5e07fc914a04e0be3de16ce6d144b.zip |
Remove outdated search API
Diffstat (limited to 'hyperkitty/api.py')
-rw-r--r-- | hyperkitty/api.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/hyperkitty/api.py b/hyperkitty/api.py index 89bc59d..15c6349 100644 --- a/hyperkitty/api.py +++ b/hyperkitty/api.py @@ -108,32 +108,6 @@ class ThreadResource(APIView): return Response(ThreadSerializer(thread).data) -class SearchResource(APIView): - """ Resource used to search the archives using the REST API. - """ - - def get(self, request, mlist_fqdn, field, keyword): - fields = ['Subject', 'Content', 'SubjectContent', 'From'] - if field not in fields: - raise ParseError(detail="Unknown field: " + field + ". Supported fields are " + ", ".join(fields)) - - store = get_store(request) - threads = None - if field == 'Subject': - threads = store.search_list_for_subject(mlist_fqdn, keyword) - elif field == 'Content': - threads = store.search_list_for_content(mlist_fqdn, keyword) - elif field == 'SubjectContent': - threads = store.search_list_for_content_subject(mlist_fqdn, keyword) - elif field == 'From': - threads = store.search_list_for_sender(mlist_fqdn, keyword) - - if not threads: - return Response(status=404) - else: - return Response(EmailSerializer(threads, many=True).data) - - class TagResource(APIView): """ Resource used to retrieve tags from the database using the REST API. |