Handle subscribe renew date, langchain, pydantic & logger.warn warnings

- Ensure langchain less than 0.2.0 is used, to prevent breaking
  ChatOpenAI, PyMuPDF usage due to their deprecation after 0.2.0
- Set subscription renewal date to a timezone aware datetime
- Use logger.warning instead of logger.warn as latter is deprecated
- Use `model_dump' not deprecated dict to get all configured content_types
This commit is contained in:
Debanjum Singh Solanky
2024-01-12 01:32:46 +05:30
parent 5f97357fe0
commit 7dfbcd2e5a
6 changed files with 11 additions and 6 deletions

View File

@@ -1,6 +1,8 @@
import os
from datetime import datetime
import factory
from django.utils.timezone import make_aware
from khoj.database.models import (
ChatModelOptions,
@@ -90,4 +92,4 @@ class SubscriptionFactory(factory.django.DjangoModelFactory):
user = factory.SubFactory(UserFactory)
type = "standard"
is_recurring = False
renewal_date = "2100-04-01"
renewal_date = make_aware(datetime.strptime("2100-04-01", "%Y-%m-%d"))