You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Getting a type error when updating the ForeignKey field to a different clan on a Nullable Foreign Key Field instance.
To Reproduce
ifawaitClan.get_or_none(tag=clantag):
clan=awaitClan.get(tag=clantag)
ifawaitPlayer.get_or_none(name=playername):
ifawaitSeason.active_seasons.all().exists():
awaitctx.send("Cannot move players between clans during an active season.")
else:
player=awaitPlayer.get(name=playername)
ifplayer.is_enabled():
player.clan=clanawaitplayer.save()
awaitctx.send(
f"Welcome @{playername} to the [{clan.tag}] {clan.name} Clan roster!"
)
else:
player.clan=clanawaitplayer.save()
awaitctx.send(
f"Welcome @{playername} to the [{clan.tag}] {clan.name} Clan roster!"
)
else:
awaitPlayer.create(name=playername, clan=clan, enabled=True)
awaitctx.send(
f"Welcome @{playername} to the [{clan.tag}] {clan.name} Clan roster!"
)
else:
awaitctx.send(f"Clan {clantag} does not exist.")
Expected behavior
This shouldn't error as the code works fine and foreign key field gets updated fine.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
Getting a type error when updating the ForeignKey field to a different clan on a Nullable Foreign Key Field instance.
To Reproduce
Expected behavior
This shouldn't error as the code works fine and foreign key field gets updated fine.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: