Sentry Issue: [POSTHOG-3ES](https://sentry.io/organizations/posthog/issues/2590699112/?referrer=github_integration)

```
TypeError: '>=' not supported between instances of 'str' and 'int'
  File "posthog/celery.py", line 271, in calculate_cohort
    calculate_cohorts()
  File "posthog/tasks/calculate_cohort.py", line 25, in calculate_cohorts
    Cohort.objects.filter(
  File "django/db/models/query.py", line 296, in __getitem__
    (k.stop is None or k.stop >= 0))), \
```
posthog/settings.py
"user_name",
    "email_opt_in",
    "organization_name",
]
SOCIAL_AUTH_GITHUB_SCOPE = ["user:email"]
SOCIAL_AUTH_GITHUB_KEY = os.getenv("SOCIAL_AUTH_GITHUB_KEY")
SOCIAL_AUTH_GITHUB_SECRET = os.getenv("SOCIAL_AUTH_GITHUB_SECRET")
SOCIAL_AUTH_GITLAB_SCOPE = ["read_user"]
SOCIAL_AUTH_GITLAB_KEY = os.getenv("SOCIAL_AUTH_GITLAB_KEY")
SOCIAL_AUTH_GITLAB_SECRET = os.getenv("SOCIAL_AUTH_GITLAB_SECRET")
SOCIAL_AUTH_GITLAB_API_URL = os.getenv("SOCIAL_AUTH_GITLAB_API_URL", "https://gitlab.com")
# Support creating multiple organizations in a single instance. Requires a premium license.
MULTI_ORG_ENABLED = get_from_env("MULTI_ORG_ENABLED", False, type_cast=str_to_bool)
# See https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-DATABASE-DISABLE_SERVER_SIDE_CURSORS
DISABLE_SERVER_SIDE_CURSORS = get_from_env("USING_PGBOUNCER", False, type_cast=str_to_bool)
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
if TEST or DEBUG:
    DATABASE_URL = os.getenv("DATABASE_URL", "postgres://localhost:5432/posthog")
else:
    DATABASE_URL = os.getenv("DATABASE_URL", "")
if DATABASE_URL:
    DATABASES = {"default": dj_database_url.config(default=DATABASE_URL, conn_max_age=600)}
    if DISABLE_SERVER_SIDE_CURSORS:
        DATABASES["default"]["DISABLE_SERVER_SIDE_CURSORS"] = True
elif os.getenv("POSTHOG_DB_NAME"):
    DATABASES = {
        "default": {
            "ENGINE": "django.db.backends.postgresql_psycopg2",
            "NAME": get_from_env("POSTHOG_DB_NAME"),