This commit is contained in:
Adolfo Gómez García 2019-11-15 13:24:22 +01:00
parent d67a1cd70c
commit 03e31f31b1
2 changed files with 5 additions and 5 deletions

View File

@ -65,8 +65,8 @@ class Storage:
key = self.__getKey(skey)
if isinstance(data, str):
data = data.encode('utf-8')
data = encoders.encode(data, 'base64', asText=True)
attr1 = '' if attr1 is None else attr1
data = encoders.encodeAsStr(data, 'base64')
attr1 = attr1 or ''
try:
DBStorage.objects.create(owner=self._owner, key=key, data=data, attr1=attr1) # @UndefinedVariable
except Exception:

View File

@ -38,7 +38,7 @@ from uds.core.util.state import State
# Not imported at runtime, just for type checking
if typing.TYPE_CHECKING:
from .service import LiveService
from . import service
logger = logging.getLogger(__name__)
@ -55,8 +55,8 @@ class LivePublication(Publication):
_templateId: str = ''
_state: str = 'r'
def service(self) -> 'LiveService':
return typing.cast('LiveService', super().service())
def service(self) -> 'service.LiveService':
return typing.cast('service.LiveService', super().service())
def marshal(self) -> bytes:
"""