Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
2e71a66d
Commit
2e71a66d
authored
Nov 23, 2015
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GitHub has a capital H
parent
6a92d4cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
lms/templates/sysadmin_dashboard.html
+2
-2
scripts/release.py
+9
-9
No files found.
lms/templates/sysadmin_dashboard.html
View file @
2e71a66d
...
...
@@ -145,8 +145,8 @@ textarea {
</li>
</ul>
<div
class=
"form-actions"
>
## Translators: Git
h
ub is a popular website for hosting code
<button
type=
"submit"
name=
"action"
value=
"add_course"
>
${_('Load new course from
gith
ub')}
</button>
## Translators: Git
H
ub is a popular website for hosting code
<button
type=
"submit"
name=
"action"
value=
"add_course"
>
${_('Load new course from
GitH
ub')}
</button>
</div>
<hr
/>
<ul
class=
"list-input"
>
...
...
scripts/release.py
View file @
2e71a66d
...
...
@@ -130,7 +130,7 @@ def ensure_pr_fetch():
def
get_github_creds
():
"""
Returns Git
h
ub credentials if they exist, as a two-tuple of (username, token).
Returns Git
H
ub credentials if they exist, as a two-tuple of (username, token).
Otherwise, return None.
"""
netrc_auth
=
requests
.
utils
.
get_netrc_auth
(
"https://api.github.com"
)
...
...
@@ -157,8 +157,8 @@ def create_github_creds():
"note"
:
"edx-release"
,
"scopes"
:
[
"repo"
],
}
username
=
raw_input
(
"Git
h
ub username: "
)
password
=
getpass
.
getpass
(
"Git
h
ub password: "
)
username
=
raw_input
(
"Git
H
ub username: "
)
password
=
getpass
.
getpass
(
"Git
H
ub password: "
)
response
=
requests
.
post
(
"https://api.github.com/authorizations"
,
auth
=
(
username
,
password
),
...
...
@@ -179,7 +179,7 @@ def create_github_creds():
if
message
!=
"Validation Failed"
:
raise
requests
.
exceptions
.
RequestException
(
message
)
else
:
# A token called "edx-release" already exists on Git
h
ub.
# A token called "edx-release" already exists on Git
H
ub.
# Delete it, and try again.
token_id
=
get_github_auth_id
(
username
,
password
,
"edx-release"
)
if
token_id
:
...
...
@@ -198,7 +198,7 @@ def create_github_creds():
def
get_github_auth_id
(
username
,
password
,
note
):
"""
Return the ID associated with the Git
h
ub auth token with the given note.
Return the ID associated with the Git
H
ub auth token with the given note.
If no such auth token exists, return None.
"""
response
=
requests
.
get
(
...
...
@@ -229,7 +229,7 @@ def delete_github_auth_token(username, password, token_id):
def
ensure_github_creds
(
attempts
=
3
):
"""
Make sure that we have Git
h
ub OAuth credentials. This will check the user's
Make sure that we have Git
H
ub OAuth credentials. This will check the user's
.netrc file, as well as the ~/.config/edx-release file. If no credentials
exist in either place, it will prompt the user to create OAuth credentials,
and store them in ~/.config/edx-release.
...
...
@@ -240,7 +240,7 @@ def ensure_github_creds(attempts=3):
return
False
# Looks like we need to create the OAuth creds
print
(
"We need to set up OAuth authentication with Git
h
ub's API. "
print
(
"We need to set up OAuth authentication with Git
H
ub's API. "
"Your password will not be stored."
,
file
=
sys
.
stderr
)
token
=
None
for
_
in
range
(
attempts
):
...
...
@@ -255,7 +255,7 @@ def ensure_github_creds(attempts=3):
else
:
break
if
token
:
print
(
"Successfully authenticated to Git
h
ub"
,
file
=
sys
.
stderr
)
print
(
"Successfully authenticated to Git
H
ub"
,
file
=
sys
.
stderr
)
if
not
token
:
print
(
"Too many invalid authentication attempts."
,
file
=
sys
.
stderr
)
return
False
...
...
@@ -333,7 +333,7 @@ def get_merge_commit(commit, branch="master"):
def
get_pr_info
(
num
):
"""
Returns the info from the Git
h
ub API
Returns the info from the Git
H
ub API
"""
url
=
"https://api.github.com/repos/edx/edx-platform/pulls/{num}"
.
format
(
num
=
num
)
username
,
token
=
get_github_creds
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment