Skip to content

Commit

Permalink
Comment out the calendar connection limit for now. (Fixes #214)
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaAutumn committed Dec 11, 2023
1 parent 6ffff25 commit f424c2c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions backend/src/appointment/database/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,17 @@ def set_subscriber_google_state(db: Session, state: str | None, subscriber_id: i

def get_connections_limit(db: Session, subscriber_id: int):
"""return the number of allowed connections for given subscriber or -1 for unlimited connections"""
db_subscriber = get_subscriber(db, subscriber_id)
mapping = {
models.SubscriberLevel.basic: int(os.getenv("TIER_BASIC_CALENDAR_LIMIT")),
models.SubscriberLevel.plus: int(os.getenv("TIER_PLUS_CALENDAR_LIMIT")),
models.SubscriberLevel.pro: int(os.getenv("TIER_PRO_CALENDAR_LIMIT")),
models.SubscriberLevel.admin: -1,
}
return mapping[db_subscriber.level]
# db_subscriber = get_subscriber(db, subscriber_id)
# mapping = {
# models.SubscriberLevel.basic: int(os.getenv("TIER_BASIC_CALENDAR_LIMIT")),
# models.SubscriberLevel.plus: int(os.getenv("TIER_PLUS_CALENDAR_LIMIT")),
# models.SubscriberLevel.pro: int(os.getenv("TIER_PRO_CALENDAR_LIMIT")),
# models.SubscriberLevel.admin: -1,
# }
# return mapping[db_subscriber.level]

# No limit right now!
return -1


def verify_subscriber_link(db: Session, url: str):
Expand Down

0 comments on commit f424c2c

Please sign in to comment.