Skip to content

self.team_id = self.initial['teams'][0]['id'] KeyError: 'teams' #60

Description

@webo111

when login success
run here.
def login(self, name, email, password):
props = {'name': name, 'login_id': email, 'password': password}
p = requests.post(
self.url + '/users/login', data=json.dumps(props),
verify=self.ssl_verify
)
if p.status_code == 200:
self.token = p.headers["Token"]
self.load_initial_data()
return json.loads(p.text)
else:
p.raise_for_status()

def load_initial_data(self):
    self.initial = self.get('/users/initial_load')
    self.team_id = self.initial['teams'][0]['id']

It was wrong:
self.team_id = self.initial['teams'][0]['id'] KeyError: 'teams'

My version of mattermost is 5.8.0 and mattermost_bot of version is 1.0.20
I need you help .thanks very match.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions