Skip to content

Commit 1db3100

Browse files
committed
Bug fixes
1 parent a4288c1 commit 1db3100

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

docs/source/changelog.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ Glossary
3131
----------------------
3232
Releases
3333
----------------------
34+
35+
v2.8.3
36+
=================
37+
- Fixed new guilds being added whenever :class:`daf.client.ACCOUNT`'s update method failed.
38+
- Fixed error if passing ``None`` inside update method of account for the ``servers`` parameter.
39+
- Removed unneded check in object serialization (for remote) which slightly increases performance.
40+
- Fixed Enum values being converted to objects when viewing live items / importing schema from live view.
41+
42+
3443
v2.8.2
3544
=================
3645
- Fixed auto installation of ttkboostrap not opening the main window at the end.

src/daf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
from .misc import *
2020

2121

22-
VERSION = "2.8.2"
22+
VERSION = "2.8.3"

src/daf/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ async def update(self, **kwargs):
491491
kwargs["intents"] = None
492492

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

495497
@misc._async_safe("_update_sem")
496498
async def update_servers(self_):
@@ -514,5 +516,6 @@ async def update_servers(self_):
514516
await update_servers(self)
515517
except Exception:
516518
await self.initialize() # re-login
519+
servers = self.servers # Only return initialized servers
517520
await update_servers(self)
518521
raise

src/daf/convert.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,8 @@ def __convert_to_slotted():
353353
if isinstance(v, LAMBDA_TYPE):
354354
v = v(_return)
355355

356-
if not isinstance(v, discord.Client): # For some reason it fails to logging when copied.
357-
v = copy.copy(v) # Prevent external modifications since it's passed by reference
358-
359-
setattr(_return, k, v)
356+
# copy.copy prevents external modifications since it's passed by reference
357+
setattr(_return, k, copy.copy(v))
360358

361359
return _return
362360

src/daf/guild.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,5 +1119,7 @@ async def update(self, init_options = None, **kwargs):
11191119
return await misc._update(self, init_options=init_options, **kwargs)
11201120
except Exception:
11211121
self.cache.clear()
1122-
await self.initialize(self.parent) # Reopen any async related connections
1122+
if self.parent is not None: # Only if it were previously initialized
1123+
await self.initialize(self.parent) # Reopen any async related connections
1124+
11231125
raise

src/daf_gui/convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def get_conversion_map(object_type):
287287

288288
object_type = type(object_)
289289

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

0 commit comments

Comments
 (0)