Skip to content

Commit

Permalink
Merge pull request #200 from dara-network/UsageDashboard_timezone_error
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy authored Nov 7, 2023
2 parents 9434d11 + cba5a51 commit f5e72c5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pages/UsageDashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def main():
)
timezone = pytz.timezone(timezone)
now = datetime.datetime.now(timezone)
now = now.replace(hour=0, minute=0, second=0, microsecond=0)
with col2:
start_time = st.date_input(
"Start Date", value=now - datetime.timedelta(days=30)
Expand All @@ -52,24 +53,25 @@ def main():
end_time = st.date_input("End Date", value=now)
time_selector = dict(created_at__gte=start_time, created_at__lte=end_time)

col1, col2, col3, col4, col5 = st.columns(5)
col1, col2, col3, col4 = st.columns([1, 1, 1, 2])
with col1:
exclude_anon = st.checkbox("Exclude Anonymous", value=True)
with col2:
exclude_team = st.checkbox("Exclude Team", value=True)
with col3:
exclude_disabled = st.checkbox("Exclude Banned", value=True)
with col4:
exclude_free = st.checkbox("Exclude Free", value=True)
with col5:
exclude_paying = st.checkbox("Exclude Paying", value=True)
paying_filter = st.selectbox(
"Paying Status",
options=["All", "Free", "Paid"],
)

app_users = get_filtered_app_users(
exclude_anon=exclude_anon,
exclude_disabled=exclude_disabled,
exclude_team=exclude_team,
exclude_free=exclude_free,
exclude_paying=exclude_paying,
exclude_free=paying_filter == "Paid",
exclude_paying=paying_filter == "Free",
)

signups = app_users.filter(**time_selector).order_by("-created_at")
Expand Down

0 comments on commit f5e72c5

Please sign in to comment.