mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
Add basic recommend feature
This commit is contained in:
11
utils.py
11
utils.py
@@ -297,14 +297,15 @@ def get_ccnet_server_addr_port():
|
||||
"""get ccnet server host and port"""
|
||||
return CCNET_SERVER_ADDR, CCNET_SERVER_PORT
|
||||
|
||||
def emails2list(emails):
|
||||
def string2list(string):
|
||||
"""
|
||||
Split email strings contacted with diffent separator.
|
||||
Split strings contacted with diffent separator to a list, and remove
|
||||
duplicated string.
|
||||
"""
|
||||
email_str = emails.replace(';', ',').replace('\n', ',').replace('\r', ',')
|
||||
# Remove empty strings and duplicate emails
|
||||
tmp_str = string.replace(';', ',').replace('\n', ',').replace('\r', ',')
|
||||
# Remove empty and duplicate strings
|
||||
s = set()
|
||||
for e in email_str.split(','):
|
||||
for e in tmp_str.split(','):
|
||||
e = e.strip(' ')
|
||||
if not e:
|
||||
continue
|
||||
|
Reference in New Issue
Block a user