Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Co-authored-by: violeta <50527601+violetaperezandrade@users.noreply.github.com>
  • Loading branch information
fjpacheco and violetaperezandrade committed May 6, 2024
1 parent aaab3e0 commit 263039a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
2 changes: 1 addition & 1 deletion app/controller/Users.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fastapi import status, Request
from fastapi import status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import JSONResponse
from service.Social import SocialService
Expand Down
28 changes: 0 additions & 28 deletions app/repository/Users.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,31 +135,3 @@ def __parse_result(self, result):
if not result:
return []
return [r.__dict__ for r in result]

@withSQLExceptionsHandle()
def get_users_to_notify(self,
date_time: datetime) -> list[tuple[int,
str,
str]]:
"""
Retrieves a list of tuples containing the alarm id, content and the
device_token of users who have an alarm scheduled for the
given datetime.
Args:
date_time (datetime): The date and time in ISO 8601 format with
timezone specified. For example, "2021-10-05T10:00:00-03:00"
represents October 5th, 2021 at 10:00 AM in Argentina Time
Zone (UTC-3). Seconds and microseconds are ignored.
Returns:
List[Tuple[int, str, str]]: A list of tuples containing
the alarm id, the alarm content, and the user's device_token.
"""
date_time = date_time.replace(second=0, microsecond=0)
logger.info(f"Searching for alarms at {date_time}")
query = self.session.query(Alarm.id,
Alarm.content,
User.device_token)\
.join(User, User.id == Alarm.id_user)\
.filter(Alarm.datetime == date_time)
result = query.all()
return result

0 comments on commit 263039a

Please sign in to comment.