mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Fix for key collision
This commit is contained in:
parent
f1f657d24f
commit
50b3c05eb3
|
@ -71,9 +71,13 @@ class LinkNode(OrderedDict):
|
||||||
super(LinkNode, self).__init__()
|
super(LinkNode, self).__init__()
|
||||||
|
|
||||||
def get_next_key(self, method):
|
def get_next_key(self, method):
|
||||||
current_val = self.methods_counter[method]
|
while True:
|
||||||
self.methods_counter[method] += 1
|
current_val = self.methods_counter[method]
|
||||||
return '{}_{}'.format(method, current_val)
|
self.methods_counter[method] += 1
|
||||||
|
|
||||||
|
key = '{}_{}'.format(method, current_val)
|
||||||
|
if key not in self:
|
||||||
|
return key
|
||||||
|
|
||||||
|
|
||||||
def insert_into(target, keys, value):
|
def insert_into(target, keys, value):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user