Merge branch 'develop' into feature/blockstack_client_refactor

This commit is contained in:
Jude Nelson
2018-05-31 17:46:24 -04:00
4 changed files with 8 additions and 3 deletions

View File

@@ -56,7 +56,6 @@ def clean_profile_entries(profile):
def fetch_profile_data_from_file():
""" takes profile data from file and saves in the profile_data DB
"""
with open(SEARCH_PROFILE_DATA_FILE, 'r') as fin:
profiles = json.load(fin)
@@ -115,6 +114,7 @@ def fetch_namespace_from_file():
continue
new_entry['username'] = username
new_entry['fqu'] = entry
new_entry['profile'] = check_entry['value']
namespace.save(new_entry)
counter += 1
@@ -176,7 +176,6 @@ def create_search_index():
if validUsername(user['username']):
pass
else:
# print "ignoring: " + user['username']
continue
profile = get_json(user['profile'])
@@ -226,6 +225,7 @@ def create_search_index():
else:
search_profile['twitter_handle'] = None
search_profile['fullyQualifiedName'] = user['fqu']
search_profile['username'] = user['username']
usernames.append(user['username'])

View File

@@ -108,4 +108,7 @@ def validUsername(username):
if len(parts) == 2:
if a.match(parts[0]) and a.match(parts[1]):
return True
if len(parts) == 3:
if a.match(parts[0]) and a.match(parts[1]) and a.match(parts[2]):
return True
return False

View File

@@ -165,7 +165,7 @@ def catch_all_post(path):
return jsonify(resp.json()), 200
@app.route('/')
@cache_control(DEFAULT_CACHE_TIMEOUT)
@cache_control(10*60)
def index():
current_dir = os.path.abspath(os.path.dirname(__file__))
server_info = blockstack.lib.client.getinfo(hostport=blockstack_indexer_url)

View File

@@ -1580,6 +1580,8 @@ Searches for a profile using a search string.
{
"results": [
{
"fullyQualifiedName": "albertwenger.id",
"username": "albertwenger",
"profile": {
"@type": "Person",
"account": [