Skip to content

Commit

Permalink
More linter corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
lorinkoz committed Feb 27, 2021
1 parent bc947d0 commit 108a4c2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 18 deletions.
21 changes: 16 additions & 5 deletions django_unmigrate/management/commands/unmigrate.py
Expand Up @@ -14,24 +14,35 @@ class Command(BaseCommand):

def add_arguments(self, parser):
parser.add_argument(
"ref", nargs="?", default=MAIN_BRANCH, help="Git ref to compare existing migrations.",
"ref",
nargs="?",
default=MAIN_BRANCH,
help="Git ref to compare existing migrations.",
)
parser.add_argument(
"--database",
default=DEFAULT_DB_ALIAS,
help='Nominates a database to synchronize. Defaults to the "default" database.',
)
parser.add_argument(
"--fake", action="store_true", help="Mark migrations as run without actually running them.",
"--fake",
action="store_true",
help="Mark migrations as run without actually running them.",
)
parser.add_argument(
"--dry-run", action="store_true", help="Just print the target migrations.",
"--dry-run",
action="store_true",
help="Just print the target migrations.",
)
parser.add_argument(
"--danger", action="store_true", help="Ignore DEBUG=False and run the command anyways.",
"--danger",
action="store_true",
help="Ignore DEBUG=False and run the command anyways.",
)
parser.add_argument(
"--clean", action="store_true", help="Delete migration files after they get unmigrated.",
"--clean",
action="store_true",
help="Delete migration files after they get unmigrated.",
)

def run_from_argv(self, argv): # pragma: no cover
Expand Down
9 changes: 4 additions & 5 deletions dunm_sandbox/myapp/migrations/0001_initial.py
Expand Up @@ -7,15 +7,14 @@ class Migration(migrations.Migration):

initial = True

dependencies = [
]
dependencies = []

operations = [
migrations.CreateModel(
name='MyModel',
name="MyModel",
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(blank=True, max_length=30)),
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("name", models.CharField(blank=True, max_length=30)),
],
),
]
6 changes: 3 additions & 3 deletions dunm_sandbox/myapp/migrations/0003_mymodel_is_paid.py
Expand Up @@ -6,13 +6,13 @@
class Migration(migrations.Migration):

dependencies = [
('myapp', '0002_mymodel_tz_created'),
("myapp", "0002_mymodel_tz_created"),
]

operations = [
migrations.AddField(
model_name='mymodel',
name='is_paid',
model_name="mymodel",
name="is_paid",
field=models.BooleanField(default=False),
),
]
23 changes: 18 additions & 5 deletions dunm_sandbox/settings.py
Expand Up @@ -73,17 +73,30 @@
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases

DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": os.path.join(BASE_DIR, "db.sqlite3"),}}
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
}
}


# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",},
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",},
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
},
{
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
},
{
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
},
]


Expand Down

0 comments on commit 108a4c2

Please sign in to comment.