Skip to content

Instantly share code, notes, and snippets.

@jasonleibowitz
Last active November 2, 2023 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonleibowitz/f2b9e762d87541b2d2b651346acdd9d5 to your computer and use it in GitHub Desktop.
Save jasonleibowitz/f2b9e762d87541b2d2b651346acdd9d5 to your computer and use it in GitHub Desktop.
"""
Soft deleting FundLimitedPartnerDocuments created between Nov 2, 2023 7:00 AM ET and 12:00 PM ET
https://carta1.atlassian.net/browse/ISD-7964
"""
from datetime import datetime
from eshares.investor_services.models import FundLimitedPartnerDocument
# Enables autorun and set `main` as the script entrypoint (both are required to use parameters)
AUTORUN_ENABLED = True
AUTORUN_ENTRYPOINT = "main"
def main() -> None:
# Gist -> https://gist.github.com/kevpwong/625d5e7dba03f6fda2df5c19974a6e49
print(f"Soft deleting FundLimitedPartnerDocuments")
docs = FundLimitedPartnerDocument.objects.filter(
document_type__in=["Annual and quarterly report",],
fundadmin_package_id__isnull=False,
created__gte=datetime(2023, 11, 2, 7, 0, 0, 0), # Nov 2, 2023 at 7:00 AM ET
created__lte=datetime(2023, 11, 2, 12, 0, 0, 0), # Nov 2, 2023 at 12:00 PM PST - after fix merged
)
docs.update(is_void=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment