Fix a typo in the index code and follow some pylint recommendations.

This commit is contained in:
yackob03 2013-11-11 16:28:05 -05:00
parent 1f1565fdaa
commit 18809842b8

View file

@ -1,6 +1,4 @@
import json
import urllib
import json
import logging
import urlparse
@ -11,7 +9,7 @@ from data import model
from app import app, mixpanel
from auth.auth import (process_auth, get_authenticated_user,
get_validated_token)
from util.names import parse_namespace_repository, parse_repository_name
from util.names import parse_repository_name
from util.email import send_confirmation_email
from auth.permissions import (ModifyRepositoryPermission, UserPermission,
ReadRepositoryPermission,
@ -54,7 +52,7 @@ def create_user():
if username == '$token':
try:
token = model.load_token_data(password)
model.load_token_data(password)
return make_response('Verified', 201)
except model.InvalidTokenException:
abort(401)
@ -130,7 +128,7 @@ def create_repository(namespace, repository):
abort(403)
else:
permission = CreateRepoPermission('namespace')
permission = CreateRepositoryPermission('namespace')
if not permission.can():
logger.info('Attempt to create a new repo with insufficient perms.')
abort(403)
@ -151,7 +149,7 @@ def create_repository(namespace, repository):
existing.delete_instance(recursive=True)
for image_description in added_images.values():
image = model.create_image(image_description['id'], repo)
model.create_image(image_description['id'], repo)
response = make_response('Created', 201)