Skip to content

Commit

Permalink
Fix for key collision
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Lubimow committed Oct 9, 2017
1 parent f1f657d commit 50b3c05
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rest_framework/schemas/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ def __init__(self):
super(LinkNode, self).__init__()

def get_next_key(self, method):
current_val = self.methods_counter[method]
self.methods_counter[method] += 1
return '{}_{}'.format(method, current_val)
while True:
current_val = self.methods_counter[method]
self.methods_counter[method] += 1

key = '{}_{}'.format(method, current_val)
if key not in self:
return key


def insert_into(target, keys, value):
Expand Down

0 comments on commit 50b3c05

Please sign in to comment.