Skip to content

Commit

Permalink
Merge pull request #12540 from rtibbles/no_future_no_future_no_future…
Browse files Browse the repository at this point in the history
…_for_me

Remove unneeded future imports
  • Loading branch information
rtibbles committed Aug 27, 2024
2 parents 3413aa1 + ff05feb commit fbf35fc
Show file tree
Hide file tree
Showing 174 changed files with 6 additions and 357 deletions.
6 changes: 1 addition & 5 deletions docs/backend_architecture/upgrade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ these migrations can be generated by executing ``kolibri manage makemigrations``

This will trigger the Django management command that will inspect the current
model schema, the current migrations, and generate new migrations to cover any
discrepancies. For some migrations, manual editing will be required to ensure
compatibility with Python 2 and 3 - this normally happens for Django Model fields
that take a ``choices`` keyword argument, where the choices are strings. The
strings should have no prefix (``u`` or ``b``) and the migration should contain
``from __future__ import unicode_literals`` as an import.
discrepancies.

For any migrations involving Foreign keys to the FacilityUser model, the migration
will automatically be generated by Django to use a swappable dependency on settings.AUTH_USER_MODEL.
Expand Down
2 changes: 1 addition & 1 deletion kolibri/core/analytics/constants/nutrition_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This module contains constants which represent what nutrition fact endpoints
notifications are returned from.
"""
from __future__ import unicode_literals


PINGBACK = "pingback"
STATISTICS = "statistics"
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/analytics/middleware.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import csv
import logging
import os
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/analytics/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-01-18 17:18
from __future__ import unicode_literals

import django.db.models.deletion
from django.db import migrations
from django.db import models
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/analytics/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models

from .constants import nutrition_endpoints
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

import logging
import os

Expand Down
2 changes: 1 addition & 1 deletion kolibri/core/auth/constants/collection_kinds.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
This module contains constants representing the kinds of Collections.
"""
from __future__ import unicode_literals


FACILITY = "facility"
CLASSROOM = "classroom"
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/constants/demographics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible

Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/constants/facility_presets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

import io
import json
import os
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/constants/morango_sync.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

from kolibri import __version__
from kolibri.utils import conf

Expand Down
2 changes: 1 addition & 1 deletion kolibri/core/auth/constants/role_kinds.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
This module contains constants representing the kinds of "roles" that a user can have with respect to a Collection.
"""
from __future__ import unicode_literals


ADMIN = "admin"
COACH = "coach"
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/csv_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

import csv
import logging
import os
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-05-14 05:22
from __future__ import unicode_literals

import uuid

import django.core.validators
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0002_auto_20170608_2125.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-06-08 21:25
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0003_auto_20170621_0958.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-06-21 16:58
from __future__ import unicode_literals

from functools import partial

from django.db import migrations
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0004_auto_20170816_1607.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-08-16 23:07
from __future__ import unicode_literals

from django.db import migrations

from kolibri.core.auth.constants.role_kinds import ADMIN
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0005_auto_20170818_1203.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-08-18 19:03
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations
from django.db import models
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0006_auto_20171206_1207.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-12-06 20:07
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations
from django.db import models
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0007_auto_20171226_1125.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-12-26 19:25
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0008_auto_20180222_1244.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-02-22 20:44
from __future__ import unicode_literals

from django.db import migrations

import kolibri.core.auth.models
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0009_auto_20180301_1123.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-01 19:23
from __future__ import unicode_literals

import django.db.models.deletion
from django.conf import settings
from django.db import migrations
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0010_auto_20180320_1320.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-20 20:20
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-23 23:56
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-24 17:48
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0013_auto_20180917_1213.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-17 16:13
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations
from django.db import models
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0014_auto_20190815_1421.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-08-15 21:21
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-11-05 17:13
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-12-09 12:34
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-12-03 18:17
from __future__ import unicode_literals

from django.db import migrations


Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0018_no_i18n_collection_kinds.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-06-22 15:50
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0019_collection_no_mptt.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-05-01 16:46
from __future__ import unicode_literals

import django.db.models.deletion
from django.db import migrations
from django.db import models
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-07-25 09:14
from __future__ import unicode_literals

from django.db import migrations

import kolibri.core.fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2023-01-31 18:19
from __future__ import unicode_literals

from django.db import migrations

import kolibri.core.fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2023-02-02 21:21
from __future__ import unicode_literals

from django.db import migrations

import kolibri.core.fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2023-03-07 20:46
from __future__ import unicode_literals

from django.db import migrations

import kolibri.core.fields
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/migrations/0024_extend_username_length.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2023-10-17 17:51
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2024-03-28 15:34
from __future__ import unicode_literals

from django.db import migrations

import kolibri.core.auth.constants.demographics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2024-05-10 21:02
from __future__ import unicode_literals

from django.db import migrations

import kolibri.core.auth.constants.demographics
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/test/sync_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import with_statement

import json
import os
import shutil
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/auth/test/test_session_middleware.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.http import HttpRequest
from django.http import HttpResponse
from django.test import SimpleTestCase
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/bookmarks/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-05-27 19:59
from __future__ import unicode_literals

import django.db.models.deletion
import morango.models.fields.uuids
from django.conf import settings
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/bookmarks/migrations/0002_bookmark_created.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-09-14 00:24
from __future__ import unicode_literals

import django.utils.timezone
from django.db import migrations
from django.db import models
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/bookmarks/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
from django.utils import timezone
from morango.models import UUIDField
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/content/base_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@
If fields are being removed or entire models deleted from this file, they should be copied
into legacy_models.py to allow for referencing during channel import of older databases.
"""
from __future__ import print_function

from django.db import models
from le_utils.constants import content_kinds
from le_utils.constants import file_formats
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/content/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-05-16 22:32
from __future__ import unicode_literals

import morango.models
from django.db import migrations
from django.db import models
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-06-06 17:16
from __future__ import unicode_literals

from django.db import migrations

import kolibri.core.fields
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/content/migrations/0003_auto_20170607_1212.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-06-07 19:12
from __future__ import unicode_literals

from django.db import migrations


Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/content/migrations/0004_auto_20170825_1038.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-08-25 17:38
from __future__ import unicode_literals

import django.db.models.deletion
import django.db.models.manager
import morango.models
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/content/migrations/0005_auto_20171009_0903.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-10-09 16:03
from __future__ import unicode_literals

from django.db import migrations
from django.db import models

Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/content/migrations/0006_auto_20171128_1703.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-11-29 01:03
from __future__ import unicode_literals

from django.db import migrations


Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/content/migrations/0007_auto_20180212_1155.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-02-12 19:55
from __future__ import unicode_literals

from django.db import migrations


Expand Down
Loading

0 comments on commit fbf35fc

Please sign in to comment.