From 59e83551df814f323b70507ff1db8894f57c2e1e Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 20 Nov 2023 11:47:11 -0800 Subject: [PATCH 1/2] Use gettext_lazy instead of ugettext_lazy ugettext_lazy was deprecated in Django 3.0 --- primed/cdsa/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primed/cdsa/views.py b/primed/cdsa/views.py index 952804a7..c48f5e75 100644 --- a/primed/cdsa/views.py +++ b/primed/cdsa/views.py @@ -15,7 +15,7 @@ from django.forms import inlineformset_factory from django.http import Http404, HttpResponseRedirect from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views.generic import DetailView, FormView, TemplateView, UpdateView from django_tables2 import MultiTableMixin, SingleTableMixin, SingleTableView From 96261d3607e5ae8bd8cf815e1c05f91f4deb271a Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 20 Nov 2023 12:06:22 -0800 Subject: [PATCH 2/2] Update factories for postgeneration save deprecation v3.3.0 deprecates saving the model after the post_generation method. Follow the factoryboy instructions for handling this warning: https://factoryboy.readthedocs.io/en/stable/changelog.html#id1 --- primed/cdsa/tests/factories.py | 1 + primed/dbgap/tests/factories.py | 2 ++ primed/users/tests/factories.py | 2 ++ 3 files changed, 5 insertions(+) diff --git a/primed/cdsa/tests/factories.py b/primed/cdsa/tests/factories.py index bf0459b8..e71482ef 100644 --- a/primed/cdsa/tests/factories.py +++ b/primed/cdsa/tests/factories.py @@ -126,3 +126,4 @@ def authorization_domains(self, create, extracted, **kwargs): class Meta: model = models.CDSAWorkspace + skip_postgeneration_save = True diff --git a/primed/dbgap/tests/factories.py b/primed/dbgap/tests/factories.py index de6f3e98..02f9bbd8 100644 --- a/primed/dbgap/tests/factories.py +++ b/primed/dbgap/tests/factories.py @@ -61,6 +61,7 @@ def studies(self, create, extracted, **kwargs): class Meta: model = models.dbGaPStudyAccession + skip_postgeneration_save = True class dbGaPWorkspaceFactory(TimeStampedModelFactory, DjangoModelFactory): @@ -78,6 +79,7 @@ class dbGaPWorkspaceFactory(TimeStampedModelFactory, DjangoModelFactory): class Meta: model = models.dbGaPWorkspace + skip_postgeneration_save = True @post_generation def authorization_domains(self, create, extracted, **kwargs): diff --git a/primed/users/tests/factories.py b/primed/users/tests/factories.py index 9fc0a2ee..6a0e0384 100644 --- a/primed/users/tests/factories.py +++ b/primed/users/tests/factories.py @@ -27,10 +27,12 @@ def password(self, create: bool, extracted: Sequence[Any], **kwargs): ).evaluate(None, None, extra={"locale": None}) ) self.set_password(password) + self.save() class Meta: model = get_user_model() django_get_or_create = ["username"] + skip_postgeneration_save = True class GroupFactory(DjangoModelFactory):