Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
webo111 opened this issue Mar 4, 2019 · 2 comments
Open

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

webo111 opened this issue Mar 4, 2019 · 2 comments

Comments

@webo111
Copy link

webo111 commented Mar 4, 2019

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.

@attzonko
Copy link
Contributor

attzonko commented Mar 5, 2019

Hi @webo111 this fork is no longer actively maintained. Feel free to give my fork a try. We renamed it to be able to make pypi releases, but it is the same code base: mmpy_bot

@webo111
Copy link
Author

webo111 commented Mar 6, 2019

Hi @webo111 this fork is no longer actively maintained. Feel free to give my fork a try. We renamed it to be able to make pypi releases, but it is the same code base: mmpy_bot

thanks. it nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants