Create parallel Player/Account fields and copy all

This commit is contained in:
Griatch 2017-07-06 22:29:52 +02:00
parent ee0e9cc053
commit 63c96de443
10 changed files with 226 additions and 2 deletions

View file

@ -24,8 +24,8 @@ class SharedMemoryManager(Manager):
if key.endswith('__exact'):
key = key[:-len('__exact')]
if key in ('pk', self.model._meta.pk.attname):
inst = self.model.get_cached_instance(kwargs[items[0]])
try:
inst = self.model.get_cached_instance(kwargs[items[0]])
# we got the item from cache, but if this is a fk, check it's ours
if getattr(inst, str(self.field).split(".")[-1]) != self.instance:
inst = None