Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhozic committed Jun 6, 2023
1 parent a4288c1 commit 1db3100
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
9 changes: 9 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ Glossary
----------------------
Releases
----------------------

v2.8.3
=================
- Fixed new guilds being added whenever :class:`daf.client.ACCOUNT`'s update method failed.
- Fixed error if passing ``None`` inside update method of account for the ``servers`` parameter.
- Removed unneded check in object serialization (for remote) which slightly increases performance.
- Fixed Enum values being converted to objects when viewing live items / importing schema from live view.


v2.8.2
=================
- Fixed auto installation of ttkboostrap not opening the main window at the end.
Expand Down
2 changes: 1 addition & 1 deletion src/daf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
from .misc import *


VERSION = "2.8.2"
VERSION = "2.8.3"
3 changes: 3 additions & 0 deletions src/daf/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ async def update(self, **kwargs):
kwargs["intents"] = None

servers = kwargs.pop("servers", self.servers + self._uiservers)
if servers is None:
servers = []

@misc._async_safe("_update_sem")
async def update_servers(self_):
Expand All @@ -514,5 +516,6 @@ async def update_servers(self_):
await update_servers(self)
except Exception:
await self.initialize() # re-login
servers = self.servers # Only return initialized servers
await update_servers(self)
raise
6 changes: 2 additions & 4 deletions src/daf/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,8 @@ def __convert_to_slotted():
if isinstance(v, LAMBDA_TYPE):
v = v(_return)

if not isinstance(v, discord.Client): # For some reason it fails to logging when copied.
v = copy.copy(v) # Prevent external modifications since it's passed by reference

setattr(_return, k, v)
# copy.copy prevents external modifications since it's passed by reference
setattr(_return, k, copy.copy(v))

return _return

Expand Down
4 changes: 3 additions & 1 deletion src/daf/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,5 +1119,7 @@ async def update(self, init_options = None, **kwargs):
return await misc._update(self, init_options=init_options, **kwargs)
except Exception:
self.cache.clear()
await self.initialize(self.parent) # Reopen any async related connections
if self.parent is not None: # Only if it were previously initialized
await self.initialize(self.parent) # Reopen any async related connections

raise
2 changes: 1 addition & 1 deletion src/daf_gui/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def get_conversion_map(object_type):

object_type = type(object_)

if object_type in {int, float, str, bool, decimal.Decimal, type(None)}:
if object_type in {int, float, str, bool, decimal.Decimal, type(None)} or isinstance(object_, Enum):
if object_type is decimal.Decimal:
object_ = float(object_)

Expand Down

0 comments on commit 1db3100

Please sign in to comment.