From f9b27e401353153e7ce0c55c2fecd77579e0d213 Mon Sep 17 00:00:00 2001 From: Mokaddem Date: Tue, 23 Aug 2016 09:50:03 +0200 Subject: [PATCH] Fixed bug in curve preventing to track concerned_pastes. Now all tracked words are put in lower case. --- bin/Curve.py | 3 ++- var/www/Flask_server.py | 8 ++++---- var/www/templates/terms_management.html | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/Curve.py b/bin/Curve.py index 9337bc5b..59557881 100755 --- a/bin/Curve.py +++ b/bin/Curve.py @@ -47,10 +47,11 @@ top_termFreq_set_array = [top_termFreq_setName_day,top_termFreq_setName_week, to def check_if_tracked_term(term, path): - if term in TrackedTermsSet_Name: + if term in server_term.smembers(TrackedTermsSet_Name): #add_paste to tracked_word_set set_name = "tracked_" + term server_term.sadd(set_name, path) + print term, 'addded', set_name, '->', path p.populate_set_out("New Term added", 'CurveManageTopSets') diff --git a/var/www/Flask_server.py b/var/www/Flask_server.py index 90267949..07878927 100755 --- a/var/www/Flask_server.py +++ b/var/www/Flask_server.py @@ -649,16 +649,16 @@ def terms_management_action(): else: if section == "followTerm": if action == "add": - r_serv_term.sadd(TrackedTermsSet_Name, term) + r_serv_term.sadd(TrackedTermsSet_Name, term.lower()) r_serv_term.hset(TrackedTermsDate_Name, term, today_timestamp) else: - r_serv_term.srem(TrackedTermsSet_Name, term) + r_serv_term.srem(TrackedTermsSet_Name, term.lower()) elif section == "blacklistTerm": if action == "add": - r_serv_term.sadd(BlackListTermsSet_Name, term) + r_serv_term.sadd(BlackListTermsSet_Name, term.lower()) r_serv_term.hset(BlackListTermsDate_Name, term, today_timestamp) else: - r_serv_term.srem(BlackListTermsSet_Name, term) + r_serv_term.srem(BlackListTermsSet_Name, term.lower()) else: return "None" diff --git a/var/www/templates/terms_management.html b/var/www/templates/terms_management.html index d070715c..487df3a7 100644 --- a/var/www/templates/terms_management.html +++ b/var/www/templates/terms_management.html @@ -289,9 +289,9 @@ function perform_operation(){ var curr_section = $(this).attr('data-section'); var curr_action = $(this).attr('data-action'); if (curr_action == "add") { - var curr_term = $('#'+curr_section+'Input').val(); + var curr_term = $('#'+curr_section+'Input').val().toLowerCase();; } else { - var curr_term = $(this).attr('data-content'); + var curr_term = $(this).attr('data-content').toLowerCase();; } var data_to_send = { section: curr_section, action:curr_action, term: curr_term};