aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vk/tracking/db
diff options
context:
space:
mode:
Diffstat (limited to 'vk/tracking/db')
-rw-r--r--vk/tracking/db/backend/log.py3
-rw-r--r--vk/tracking/db/record.py5
2 files changed, 4 insertions, 4 deletions
diff --git a/vk/tracking/db/backend/log.py b/vk/tracking/db/backend/log.py
index 1ea009b..814cabc 100644
--- a/vk/tracking/db/backend/log.py
+++ b/vk/tracking/db/backend/log.py
@@ -70,8 +70,7 @@ class Writer(meta.Writer):
def _format_user(user):
if user.has_last_name():
return '{} {}'.format(user.get_first_name(), user.get_last_name())
- else:
- return '{}'.format(user.get_first_name())
+ return '{}'.format(user.get_first_name())
@staticmethod
def _format_user_is_online(user):
diff --git a/vk/tracking/db/record.py b/vk/tracking/db/record.py
index c03c3ca..dfd47c6 100644
--- a/vk/tracking/db/record.py
+++ b/vk/tracking/db/record.py
@@ -7,10 +7,11 @@ from collections import OrderedDict
from collections.abc import MutableMapping
from datetime import datetime
-from .timestamp import Timestamp
from vk.last_seen import LastSeen, LastSeenField
from vk.user import User, UserField
+from .timestamp import Timestamp
+
class Record(MutableMapping):
FIELDS = (
UserField.UID,
@@ -95,6 +96,6 @@ class Record(MutableMapping):
self._update_user_field(user, field)
else:
assert False
- if len(last_seen):
+ if last_seen:
user.set_last_seen(last_seen)
return user