Fix the call that determines if an organization has enough private repositories.
This commit is contained in:
parent
ac72a8d86d
commit
296695cb87
2 changed files with 18 additions and 22 deletions
|
@ -286,15 +286,9 @@ def get_organization(orgname):
|
||||||
|
|
||||||
@app.route('/api/organization/<orgname>/private', methods=['GET'])
|
@app.route('/api/organization/<orgname>/private', methods=['GET'])
|
||||||
def get_organization_private_allowed(orgname):
|
def get_organization_private_allowed(orgname):
|
||||||
if current_user.is_anonymous():
|
permission = CreateRepositoryPermission(orgname)
|
||||||
abort(404)
|
if permission.can():
|
||||||
|
organization = model.get_organization(orgname)
|
||||||
user = current_user.db_user()
|
|
||||||
|
|
||||||
try:
|
|
||||||
organization = model.get_organization(orgname, username = user.username)
|
|
||||||
except:
|
|
||||||
abort(404)
|
|
||||||
|
|
||||||
private_repos = model.get_private_repo_count(organization.username)
|
private_repos = model.get_private_repo_count(organization.username)
|
||||||
if organization.stripe_id:
|
if organization.stripe_id:
|
||||||
|
@ -310,6 +304,8 @@ def get_organization_private_allowed(orgname):
|
||||||
'privateAllowed': False
|
'privateAllowed': False
|
||||||
})
|
})
|
||||||
|
|
||||||
|
abort(403)
|
||||||
|
|
||||||
|
|
||||||
def member_view(m):
|
def member_view(m):
|
||||||
return {
|
return {
|
||||||
|
|
Reference in a new issue