Skip to content

Commit

Permalink
🚨(backend) remove python warnings
Browse files Browse the repository at this point in the history
First set `DEFAULT_AUTO_FIELD` settings to remove a Django warning. Then update
`create_demo_site` script to remove a python 3.9 deprecation warnings about the
use of `random.sample` with a set as first argument.
  • Loading branch information
jbpenrath committed Feb 18, 2022
1 parent d1c2375 commit 7bf7baf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions sandbox/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class Base(StyleguideMixin, DRFMixin, RichieCoursesConfigurationMixin, Configura
"PORT": values.Value(5432, environ_name="DB_PORT", environ_prefix=None),
}
}
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
MIGRATION_MODULES = {}

# Static files (CSS, JavaScript, Images)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def create_footer_link(**link_info):
page_parent=pages_created["courses"],
fill_licences=course_licences,
fill_team=random.sample(
eligible_persons,
list(eligible_persons),
min(
random.randint(1, defaults.NB_OBJECTS["course_persons"]), # nosec
len(eligible_persons),
Expand Down

0 comments on commit 7bf7baf

Please sign in to comment.