Giter Club home page Giter Club logo

friends_keeper's People

Contributors

dependabot[bot] avatar yeyeto2788 avatar

Watchers

 avatar  avatar

friends_keeper's Issues

Update notification error

Not able to update notification's date based on the notification id.

Error:

$ friends_keeper update notification --notification-id 1 --date 01/03/22

Using debug level 20
2022-03-02 17:42:21,338 [friends_keeper.utils] - [INFO] Loading configuration from '/home/yeyeto2788/workspace/own_workspace/friends_keeper/config.yaml'
2022-03-02 17:42:21,339 [friends_keeper.utils] - [DEBUG] Validating configuration file content.
2022-03-02 17:42:21,344 [friends_keeper.utils] - [DEBUG] Config file schema is valid.
2022-03-02 17:42:21,344 [friends_keeper.utils] - [INFO] Using './friends_keeper.log' for logging
2022-03-02 17:42:21,345 [friends_keeper.utils.orm.notifications] - [INFO] Querying database for notification event '1'
2022-03-02 17:42:21,346 [friends_keeper.utils.orm] - [DEBUG] Executing query: 'SELECT notifications.id, notifications.friend_id, notifications.date, notifications.already_notified 
FROM notifications 
WHERE notifications.id = :id_1'
2022-03-02 17:42:21,348 [friends_keeper.utils.orm] - [DEBUG] Query executed!
2022-03-02 17:42:21,348 [friends_keeper.utils.orm.notifications] - [INFO] Found notification event: '[NotificationEvent: {'id': 1, 'friend_id': 1, 'date': '01/03/22', 'already_notified': False}]'
Traceback (most recent call last):
  File "/home/yeyeto2788/workspace/own_workspace/friends_keeper/.venv/bin/friends_keeper", line 5, in <module>
    main_cli()
  File "/home/yeyeto2788/workspace/own_workspace/friends_keeper/.venv/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/yeyeto2788/workspace/own_workspace/friends_keeper/.venv/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/yeyeto2788/workspace/own_workspace/friends_keeper/.venv/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/yeyeto2788/workspace/own_workspace/friends_keeper/.venv/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/yeyeto2788/workspace/own_workspace/friends_keeper/.venv/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/yeyeto2788/workspace/own_workspace/friends_keeper/.venv/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/yeyeto2788/workspace/own_workspace/friends_keeper/.venv/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/yeyeto2788/workspace/own_workspace/friends_keeper/friends_keeper/cli/update.py", line 189, in notification
    friend = get_friend(friend_id=notification.friend_id)
AttributeError: 'list' object has no attribute 'friend_id'

Past notifications not showing up

Past notifications are not taking into consideration when executed next time. i.e: You stop the container or even do not execute it in a while.

Note: No actual error on execution as shown below but after checking the database the update of the notification date was successfull.
Update of the notification date:

$ friends_keeper update notification --notification-id 1 --date 01/03/22

Using debug level 20
2022-03-02 17:46:50,239 [friends_keeper.utils] - [INFO] Loading configuration from '/home/yeyeto2788/workspace/own_workspace/friends_keeper/config.yaml'
2022-03-02 17:46:50,241 [friends_keeper.utils] - [DEBUG] Validating configuration file content.
2022-03-02 17:46:50,246 [friends_keeper.utils] - [DEBUG] Config file schema is valid.
2022-03-02 17:46:50,246 [friends_keeper.utils] - [INFO] Using './friends_keeper.log' for logging
2022-03-02 17:46:50,246 [friends_keeper.utils.orm.notifications] - [INFO] Querying database for notification event '1'
2022-03-02 17:46:50,247 [friends_keeper.utils.orm] - [DEBUG] Executing query: 'SELECT notifications.id, notifications.friend_id, notifications.date, notifications.already_notified 
FROM notifications 
WHERE notifications.id = :id_1'
2022-03-02 17:46:50,250 [friends_keeper.utils.orm] - [DEBUG] Query executed!
2022-03-02 17:46:50,250 [friends_keeper.utils.orm.notifications] - [INFO] Found notification event: 'NotificationEvent: {'id': 1, 'friend_id': 1, 'date': '01/03/22', 'already_notified': False}'
2022-03-02 17:46:50,250 [friends_keeper.utils.orm.friends] - [INFO] Querying database for a friend with ID '1'.
2022-03-02 17:46:50,251 [friends_keeper.utils.orm] - [DEBUG] Executing query: 'SELECT friends.id, friends.name, friends.last_name, friends.nickname, friends.relationship, friends.min_days, friends.max_days, friends.active 
FROM friends 
WHERE friends.id = :id_1'
2022-03-02 17:46:50,252 [friends_keeper.utils.orm] - [DEBUG] Query executed!
2022-03-02 17:46:50,252 [friends_keeper.utils.orm.friends] - [INFO] Friend found: [Friend: {'id': 1, 'name': 'Friend1', 'last_name': 'Last', 'nickname': 'Friend1 Last', 'relationship': 'friend', 'active': True, 'min_days': 15, 'max_days': 30}]
2022-03-02 17:46:50,252 [friends_keeper.utils.orm.notifications] - [INFO] Updating notification event from friend ID '1' with '2022-03-01 00:00:00' date.
2022-03-02 17:46:50,253 [friends_keeper.utils.orm] - [DEBUG] Executing query: 'UPDATE notifications SET date=:date WHERE notifications.friend_id = :friend_id_1'
2022-03-02 17:46:50,254 [friends_keeper.utils.orm] - [DEBUG] Commiting query: 'UPDATE notifications SET date=:date WHERE notifications.friend_id = :friend_id_1'
2022-03-02 17:46:50,254 [friends_keeper.utils.orm] - [DEBUG] Query committed!
2022-03-02 17:46:50,254 [friends_keeper.utils.orm.notifications] - [INFO] Notification updated with new date 2022-03-01 00:00:00.

Notification for friend 'Friend1 Last' updated with date '01/03/22'

Error:

$ friends_keeper run

Using debug level 20
2022-03-02 17:44:35,568 [friends_keeper.utils] - [INFO] Loading configuration from '/home/yeyeto2788/workspace/own_workspace/friends_keeper/config.yaml'
2022-03-02 17:44:35,570 [friends_keeper.utils] - [DEBUG] Validating configuration file content.
2022-03-02 17:44:35,574 [friends_keeper.utils] - [DEBUG] Config file schema is valid.
2022-03-02 17:44:35,574 [friends_keeper.utils] - [INFO] Using './friends_keeper.log' for logging
2022-03-02 17:44:35,575 [friends_keeper.utils.orm.notifications] - [DEBUG] Querying database for today's notification events
2022-03-02 17:44:35,576 [friends_keeper.utils.orm] - [DEBUG] Executing query: 'SELECT notifications.id, notifications.friend_id, notifications.date, notifications.already_notified 
FROM notifications 
WHERE notifications.already_notified = false AND notifications.date = :date_1'
2022-03-02 17:44:35,578 [friends_keeper.utils.orm] - [DEBUG] Query executed!
2022-03-02 17:44:35,578 [friends_keeper.utils.orm.notifications] - [DEBUG] Found notification events'[]'
2022-03-02 17:44:35,578 [friends_keeper.core] - [INFO] We didn't find any notifications for today

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.