mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-12 08:16:33 +02:00
fix bug
This commit is contained in:
@@ -213,6 +213,8 @@ class Anonymous_Github:
|
|||||||
@application.route('/myrepo', methods=['GET'])
|
@application.route('/myrepo', methods=['GET'])
|
||||||
def myrepo():
|
def myrepo():
|
||||||
user = session.get('user', None)
|
user = session.get('user', None)
|
||||||
|
if user is None or 'token' not in user or user['token'] is None:
|
||||||
|
return redirect('github/login')
|
||||||
g = github.Github(user['token']['access_token'])
|
g = github.Github(user['token']['access_token'])
|
||||||
repos = g.get_user().get_repos(sort="full_name")
|
repos = g.get_user().get_repos(sort="full_name")
|
||||||
for repo in repos:
|
for repo in repos:
|
||||||
@@ -520,7 +522,7 @@ class Anonymous_Github:
|
|||||||
os.mkdir(config_path)
|
os.mkdir(config_path)
|
||||||
with open(config_path + "/config.json", 'w') as outfile:
|
with open(config_path + "/config.json", 'w') as outfile:
|
||||||
token = None
|
token = None
|
||||||
if user is not None and 'token' in user:
|
if user is not None and 'token' in user and user['token'] is not None:
|
||||||
token = user['token']['access_token']
|
token = user['token']['access_token']
|
||||||
json.dump({
|
json.dump({
|
||||||
"id": id,
|
"id": id,
|
||||||
|
|||||||
Reference in New Issue
Block a user