Commit decac630 authored by Martin Matějek's avatar Martin Matějek

Pass storing notification failure to user as bool value

parent 164d0024
......@@ -74,7 +74,7 @@ class Api:
# data manipulation
def store(self, n):
"""Store already created notification"""
self.notifications.store(n)
return self.notifications.store(n)
def create(self, skel_id, **user_opts):
"""
......@@ -94,7 +94,10 @@ class Api:
notification_defaults.update(user_opts)
notif = Notification.new(skel, **notification_defaults)
self.notifications.store(notif)
success = self.notifications.store(notif)
if not success:
return False
return notif.notif_id
......
......@@ -50,6 +50,9 @@ class NotificationStorage:
f.write(n.serialize())
except OSError:
logger.error("Error during writing notification to disk!")
return False
return True
def load(self, storage_dir):
"""Deserialize all notifications from FS"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment