def delete_tag(tag):
    logging.debug("check_post_duplicates")
    if check_login_2():
        session = get_current_session()
        #email = session['email']
        filters = {
            "tag": tag,
        }
        results, results_exist = datastore_results("Tag", filters = filters, inequality_filters = None, order = None, fetch_total = 1, offset = 0, mem_key = None)
        if not results_exist:
            return False
        
        for result in results:
            key = result.key()
            db.delete(key)
            return True
    else:
        return False
def delete_comment(comment_id):
    logging.debug("delete_comment")
    if check_login_2():
        session = get_current_session()
        email = session['email']
        filters = {
            "email": email,
            "comment_id": comment_id,
        }
        results, results_exist = datastore_results("Comment", filters = filters, inequality_filters = None, order = None, fetch_total = 1, offset = 0, mem_key = None)
        if not results_exist:
            return False
        
        for result in results:
            key = result.key()
            db.delete(key)
            return True
    else:
        return False