Skip to content

Commit

Permalink
Move generate_object_id into migration utils
Browse files Browse the repository at this point in the history
  • Loading branch information
cslzchen committed Jul 13, 2022
1 parent c58fc2b commit f922435
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion osf/utils/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json
import logging
import warnings
import bson
from math import ceil


Expand All @@ -13,7 +14,6 @@
from django.db import connection
from django.db.migrations.operations.base import Operation

from osf.models.base import generate_object_id
from osf.utils.sanitize import strip_html, unescape_entities
from website import settings
from website.project.metadata.schemas import get_osf_meta_schemas
Expand Down Expand Up @@ -41,6 +41,11 @@
('textarea-xl', 'string'): 'long-text-input',
}


def generate_object_id():
return str(bson.ObjectId())


def get_osf_models():
"""
Helper function to retrieve all osf related models.
Expand Down

0 comments on commit f922435

Please sign in to comment.