mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
slack importer: Get user data from a get request to slack users api.
The fresh imported data shows that the users emails are not included in the data. However, the data received from the older method of slack (which is using legacy tokens) contains the email data of the users.
This commit is contained in:
@@ -21,6 +21,9 @@ class Command(BaseCommand):
|
||||
parser.add_argument('realm_name', metavar='<realm_name>',
|
||||
type=str, help="Realm Name")
|
||||
|
||||
parser.add_argument('--token', metavar='<slack_token>',
|
||||
type=str, help='Slack legacy token of the organsation')
|
||||
|
||||
parser.add_argument('--output', dest='output_dir',
|
||||
action="store", default=None,
|
||||
help='Directory to write exported data to.')
|
||||
@@ -37,14 +40,19 @@ class Command(BaseCommand):
|
||||
os.makedirs(output_dir)
|
||||
|
||||
realm_name = options['realm_name']
|
||||
token = options['token']
|
||||
if realm_name is None:
|
||||
print("Enter realm name!")
|
||||
exit(1)
|
||||
|
||||
if token is None:
|
||||
print("Enter slack legacy token!")
|
||||
exit(1)
|
||||
|
||||
for path in options['slack_data_zip']:
|
||||
if not os.path.exists(path):
|
||||
print("Slack data directory not found: '%s'" % (path,))
|
||||
exit(1)
|
||||
|
||||
print("Converting Data ...")
|
||||
do_convert_data(path, realm_name, output_dir)
|
||||
do_convert_data(path, realm_name, output_dir, token)
|
||||
|
||||
Reference in New Issue
Block a user