Upgrade black
This commit is contained in:
parent
2085f0bc89
commit
37175e54fb
16 changed files with 34 additions and 27 deletions
|
@ -24,7 +24,7 @@ repos:
|
|||
- id: isort
|
||||
types: [python]
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 19.10b0
|
||||
rev: 20.8b1
|
||||
hooks:
|
||||
- id: black
|
||||
types: [python]
|
||||
|
|
|
@ -17,9 +17,12 @@ class Command(BaseCommand):
|
|||
url = (settings.BLOG["base_url"] + url).replace(
|
||||
"//", "/"
|
||||
) + "?status__exact=pending"
|
||||
message = ngettext(
|
||||
message = (
|
||||
ngettext(
|
||||
"There is %(count)d comment pending review.\n%(url)s",
|
||||
"There are %(count)d comments pending review.\n%(url)s",
|
||||
count,
|
||||
) % {"count": count, "url": url}
|
||||
)
|
||||
% {"count": count, "url": url}
|
||||
)
|
||||
mail_admins("Comments pending review", message)
|
||||
|
|
|
@ -125,6 +125,6 @@ class Migration(migrations.Migration):
|
|||
"verbose_name_plural": "users",
|
||||
"abstract": False,
|
||||
},
|
||||
managers=[("objects", django.contrib.auth.models.UserManager()),],
|
||||
managers=[("objects", django.contrib.auth.models.UserManager())],
|
||||
),
|
||||
]
|
||||
|
|
|
@ -45,6 +45,6 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
],
|
||||
options={"ordering": ["-published_at"],},
|
||||
options={"ordering": ["-published_at"]},
|
||||
),
|
||||
]
|
||||
|
|
|
@ -11,9 +11,9 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="page", options={"ordering": ["position", "-published_at"]},
|
||||
name="page", options={"ordering": ["position", "-published_at"]}
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="page", name="position", field=models.IntegerField(default=0),
|
||||
model_name="page", name="position", field=models.IntegerField(default=0)
|
||||
),
|
||||
]
|
||||
|
|
|
@ -11,7 +11,7 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="comment", options={"ordering": ["-created_at"]},
|
||||
name="comment", options={"ordering": ["-created_at"]}
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="comment",
|
||||
|
|
|
@ -11,6 +11,6 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name="comment", old_name="active", new_name="approved",
|
||||
model_name="comment", old_name="active", new_name="approved"
|
||||
),
|
||||
]
|
||||
|
|
|
@ -11,7 +11,7 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="comment", options={"ordering": ["created_at"]},
|
||||
name="comment", options={"ordering": ["created_at"]}
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="comment",
|
||||
|
|
|
@ -10,7 +10,7 @@ class Migration(migrations.Migration):
|
|||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(model_name="comment", name="approved",),
|
||||
migrations.RemoveField(model_name="comment", name="approved"),
|
||||
migrations.AddField(
|
||||
model_name="comment",
|
||||
name="status",
|
||||
|
|
|
@ -11,6 +11,6 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="comment", options={"ordering": ["-created_at"]},
|
||||
name="comment", options={"ordering": ["-created_at"]}
|
||||
),
|
||||
]
|
||||
|
|
|
@ -11,6 +11,6 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="comment", options={"ordering": ["created_at"]},
|
||||
name="comment", options={"ordering": ["created_at"]}
|
||||
),
|
||||
]
|
||||
|
|
|
@ -89,9 +89,7 @@ class ArticleDetailView(FormMixin, generic.DetailView):
|
|||
comment = form.save(commit=False)
|
||||
comment.article = self.object
|
||||
comment.save()
|
||||
messages.success(
|
||||
self.request, "Comment successfully saved, pending review.",
|
||||
)
|
||||
messages.success(self.request, "Comment successfully saved, pending review.")
|
||||
return super().form_valid(form)
|
||||
|
||||
def get_success_url(self):
|
||||
|
|
|
@ -11,9 +11,14 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name="attachment", old_name="file", new_name="original_file",
|
||||
model_name="attachment",
|
||||
old_name="file",
|
||||
new_name="original_file",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="attachment",
|
||||
name="processed",
|
||||
),
|
||||
migrations.RemoveField(model_name="attachment", name="processed",),
|
||||
migrations.AddField(
|
||||
model_name="attachment",
|
||||
name="processed_file",
|
||||
|
|
|
@ -11,6 +11,7 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="attachment", options={"ordering": ["description"]},
|
||||
name="attachment",
|
||||
options={"ordering": ["description"]},
|
||||
),
|
||||
]
|
||||
|
|
|
@ -65,7 +65,7 @@ class Attachment(models.Model):
|
|||
}
|
||||
check_data = {**base_data, **post_data}
|
||||
while res_data["Status"]["Code"] == "1":
|
||||
response = requests.post(url=url, data=check_data,)
|
||||
response = requests.post(url=url, data=check_data)
|
||||
res_data = response.json()[0]
|
||||
|
||||
# Download image
|
||||
|
|
|
@ -130,11 +130,11 @@ DATABASES = {
|
|||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
||||
"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.MinimumLengthValidator"},
|
||||
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
|
||||
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
|
||||
]
|
||||
|
||||
|
||||
|
|
Reference in a new issue