Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 0dd4fc8

Browse files
committed
Merge pull request #659 from misho-kr/master
avoid using a variable twice in the same function
2 parents 388d303 + 9338667 commit 0dd4fc8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docker_registry/index.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ def put_username(username):
5151
return toolkit.response('', 204)
5252

5353

54-
def update_index_images(namespace, repository, data):
54+
def update_index_images(namespace, repository, data_arg):
5555
path = store.index_images_path(namespace, repository)
5656
sender = flask.current_app._get_current_object()
5757
try:
5858
images = {}
5959
# Note(dmp): unicode patch
60-
data = json.loads(data.decode('utf8')) + store.get_json(path)
60+
data = json.loads(data_arg.decode('utf8')) + store.get_json(path)
6161
for i in data:
6262
iid = i['id']
6363
if iid in images and 'checksum' in images[iid]:
@@ -76,8 +76,8 @@ def update_index_images(namespace, repository, data):
7676
signals.repository_created.send(
7777
sender, namespace=namespace, repository=repository,
7878
# Note(dmp): unicode patch
79-
value=json.loads(data.decode('utf8')))
80-
store.put_content(path, data)
79+
value=json.loads(data_arg.decode('utf8')))
80+
store.put_content(path, data_arg)
8181

8282

8383
@app.route('/v1/repositories/<path:repository>', methods=['PUT'])

0 commit comments

Comments
 (0)