I learned something I didn't know about Django:
Apparently, if you retrieve the same model instance with two different references, they don't equate with is or ==, you need to compare the id's. I could be misreading the symptoms, but this is what I had to do to get it to recognize that the home of the object in question was its current (going away) location, and act appropriately.
This commit is contained in:
parent
13b19b9a16
commit
7f3a8870f0
1 changed files with 1 additions and 1 deletions
|
|
@ -442,7 +442,7 @@ class Object(models.Model):
|
||||||
text = "player"
|
text = "player"
|
||||||
|
|
||||||
# Obviously, we can't send it back to here.
|
# Obviously, we can't send it back to here.
|
||||||
if home is self:
|
if home.id == self.id:
|
||||||
obj.home = default_home
|
obj.home = default_home
|
||||||
obj.save()
|
obj.save()
|
||||||
home = default_home
|
home = default_home
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue