Skip to content

Commit

Permalink
Fix inconsistent indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
unode committed Aug 13, 2020
1 parent 5e8cdf8 commit d5cdfb0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions mmpy_bot/mattermost.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get_file_link(self, file_id):
return self.get('/files/{}/link'.format(file_id))

def get_team_by_name(self, team_name):
return self.get('/teams/name/{}'.format(team_name))
return self.get('/teams/name/{}'.format(team_name))

def get_team_id(self, channel_id):
for team_id, channels in self.teams_channels_ids.items():
Expand Down Expand Up @@ -125,21 +125,21 @@ def in_webhook(url, channel, text, username=None, as_user=None,
}, verify=ssl_verify)

def login(self, team, account, password):
props = {'login_id': account, 'password': password}
props = {'login_id': account, 'password': password}
response = self._login(props)
if response.status_code in [301, 302, 307]:
# reset self.url to the new URL
self.url = response.headers['Location'].replace(
'/users/login', '')
# re-try login if redirected
response = self._login(props)
if response.status_code in [301, 302, 307]:
# reset self.url to the new URL
self.url = response.headers['Location'].replace(
'/users/login', '')
# re-try login if redirected
response = self._login(props)
if response.status_code == 200:
self.token = response.headers["Token"]
self.load_initial_data()
user = json.loads(response.text)
return user
else:
response.raise_for_status()
if response.status_code == 200:
self.token = response.headers["Token"]
self.load_initial_data()
user = json.loads(response.text)
return user
else:
response.raise_for_status()

def _login(self, props):
return requests.post(
Expand Down
4 changes: 2 additions & 2 deletions mmpy_bot/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def _default_scheduler__once(self, trigger_time):

def _once(trigger_time=datetime.now()):
if not isinstance(trigger_time, datetime):
raise AssertionError(
"The trigger_time parameter should be a datetime object.")
raise AssertionError(
"The trigger_time parameter should be a datetime object.")
return default_scheduler.once(
self=default_scheduler,
trigger_time=trigger_time)
Expand Down

0 comments on commit d5cdfb0

Please sign in to comment.