Update all the pre-commit hooks
This commit is contained in:
parent
e17f17385a
commit
6fdfdca442
|
@ -1,6 +1,6 @@
|
|||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: check-case-conflict
|
||||
- id: check-merge-conflict
|
||||
|
@ -15,21 +15,22 @@ repos:
|
|||
- id: trailing-whitespace
|
||||
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: "v3.3.0"
|
||||
rev: "v3.15.0"
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py310-plus]
|
||||
args: [--py311-plus]
|
||||
|
||||
- repo: https://github.com/adamchainz/django-upgrade
|
||||
rev: "1.13.0"
|
||||
rev: "1.15.0"
|
||||
hooks:
|
||||
- id: django-upgrade
|
||||
args: [--target-version, "4.2"]
|
||||
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.10.0
|
||||
- repo: https://github.com/psf/black-pre-commit-mirror
|
||||
rev: 23.11.0
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3.11
|
||||
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: 5.12.0
|
||||
|
@ -38,12 +39,12 @@ repos:
|
|||
args: ["--profile=black"]
|
||||
|
||||
- repo: https://github.com/pycqa/flake8
|
||||
rev: 6.0.0
|
||||
rev: 6.1.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v0.991
|
||||
rev: v1.6.1
|
||||
hooks:
|
||||
- id: mypy
|
||||
exclude: "^tests/"
|
||||
|
@ -51,8 +52,6 @@ repos:
|
|||
[types-pyopenssl, types-mock, types-cachetools, types-python-dateutil]
|
||||
|
||||
- repo: https://github.com/rtts/djhtml
|
||||
rev: v1.5.2
|
||||
rev: 3.0.6
|
||||
hooks:
|
||||
- id: djhtml
|
||||
- id: djcss
|
||||
- id: djjs
|
||||
|
|
|
@ -8,7 +8,6 @@ import stator.models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0001_initial"),
|
||||
]
|
||||
|
|
|
@ -10,7 +10,6 @@ import core.uploads
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0002_hashtag"),
|
||||
]
|
||||
|
|
|
@ -11,7 +11,6 @@ import stator.models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0003_identity_followers_etc"),
|
||||
("activities", "0003_postattachment_null_thumb"),
|
||||
|
|
|
@ -14,7 +14,6 @@ def timelineevent_populate_published(apps, schema_editor):
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0004_emoji_post_emojis"),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0005_report"),
|
||||
("activities", "0005_post_type_timeline_urls"),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0006_fanout_subject_identity_alter_fanout_type"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0007_post_stats"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0011_announcement"),
|
||||
("activities", "0008_state_and_post_indexes"),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0013_stator_indexes"),
|
||||
("activities", "0009_alter_timelineevent_index_together"),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0010_stator_indexes"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0011_postinteraction_value_alter_postinteraction_type"),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0015_bookmark"),
|
||||
("activities", "0012_in_reply_to_index"),
|
||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0013_postattachment_author"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0014_post_content_vector_gin"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0015_alter_postinteraction_type"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0017_stator_next_change"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0018_timelineevent_dismissed"),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0008_follow_boosts"),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("api", "0002_remove_token_code_token_revoked_alter_token_token_and_more"),
|
||||
]
|
||||
|
|
|
@ -10,7 +10,6 @@ import core.uploads
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0016_hashtagfollow"),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("stator", "0001_initial"),
|
||||
]
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
{% for attachment in post.attachments.all %}
|
||||
{% if attachment.is_image %}
|
||||
<a href="{{ attachment.full_url.relative }}" class="image" target="_blank"
|
||||
_="on click halt the event then call imageviewer.show(me)">
|
||||
_="on click halt the event then call imageviewer.show(me)">
|
||||
<img src="{{ attachment.thumbnail_url.relative }}" title="{{ attachment.name }}" alt="{{ attachment.name|default:'(no description)' }}" loading="lazy" data-original-url="{{ attachment.full_url.relative }}">
|
||||
{% if attachment.name %}
|
||||
<div class="badge">ALT</div>
|
||||
|
|
|
@ -39,44 +39,44 @@
|
|||
<div class="field payload">
|
||||
<span class="name">Raw Response:
|
||||
<a title="Copy Content"
|
||||
class="copy"
|
||||
_="on click
|
||||
writeText(#raw_response.innerText) into the navigator's clipboard
|
||||
then add .copied
|
||||
wait 2s
|
||||
then remove .copied">
|
||||
class="copy"
|
||||
_="on click
|
||||
writeText(#raw_response.innerText) into the navigator's clipboard
|
||||
then add .copied
|
||||
wait 2s
|
||||
then remove .copied">
|
||||
<i class="fa-solid fa-copy"></i>
|
||||
</a>
|
||||
</span>
|
||||
<span class="value">
|
||||
<a _="on click
|
||||
toggle .hidden on #raw_response
|
||||
then
|
||||
if my.innerText is 'Hide' set my.innerText to 'Show'
|
||||
else set my.innerText to 'Hide'
|
||||
">Show</a></span>
|
||||
toggle .hidden on #raw_response
|
||||
then
|
||||
if my.innerText is 'Hide' set my.innerText to 'Show'
|
||||
else set my.innerText to 'Hide'
|
||||
">Show</a></span>
|
||||
</div>
|
||||
<pre id="raw_response" class="hidden">{{ raw_result }}</pre>
|
||||
|
||||
<div class="field payload">
|
||||
<span class="name">Canonical:
|
||||
<a title="Copy Content"
|
||||
class="copy"
|
||||
_="on click
|
||||
writeText(#canonical_response.innerText) into the navigator's clipboard
|
||||
then add .copied
|
||||
wait 2s
|
||||
then remove .copied">
|
||||
class="copy"
|
||||
_="on click
|
||||
writeText(#canonical_response.innerText) into the navigator's clipboard
|
||||
then add .copied
|
||||
wait 2s
|
||||
then remove .copied">
|
||||
<i class="fa-solid fa-copy"></i>
|
||||
</a>
|
||||
</span>
|
||||
<span class="value">
|
||||
<a _="on click
|
||||
toggle .hidden on #canonical_response
|
||||
then
|
||||
if my.innerText is 'Hide' set my.innerText to 'Show'
|
||||
else set my.innerText to 'Hide'
|
||||
">Show</a></span>
|
||||
toggle .hidden on #canonical_response
|
||||
then
|
||||
if my.innerText is 'Hide' set my.innerText to 'Show'
|
||||
else set my.innerText to 'Hide'
|
||||
">Show</a></span>
|
||||
</div>
|
||||
<pre id="canonical_response" class="hidden">{{ result }}</pre>
|
||||
</div>
|
||||
|
|
|
@ -80,9 +80,9 @@
|
|||
</span>
|
||||
<div class="right">
|
||||
<button class="fa-solid fa-trash delete" title="Delete Row"
|
||||
_="on click remove (closest parent .option)
|
||||
then {{ field.name }}.collect{{ field.name|title }}Fields()
|
||||
then halt" />
|
||||
_="on click remove (closest parent .option)
|
||||
then {{ field.name }}.collect{{ field.name|title }}Fields()
|
||||
then halt" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
_="on click halt the event then call imageviewer.show(me)"
|
||||
>
|
||||
<img src="{{ identity.local_icon_url.relative }}" class="icon"
|
||||
data-original-url="{{ identity.local_icon_url.relative }}"
|
||||
alt="Profile image for {{ identity.name }}"
|
||||
data-original-url="{{ identity.local_icon_url.relative }}"
|
||||
alt="Profile image for {{ identity.name }}"
|
||||
>
|
||||
</span>
|
||||
|
||||
|
@ -47,13 +47,13 @@
|
|||
<small>
|
||||
@{{ identity.handle }}
|
||||
<a title="Copy handle"
|
||||
class="copy"
|
||||
tabindex="0"
|
||||
_="on click or keyup[key is 'Enter']
|
||||
writeText('@{{ identity.handle }}') into the navigator's clipboard
|
||||
then add .copied
|
||||
wait 2s
|
||||
then remove .copied">
|
||||
class="copy"
|
||||
tabindex="0"
|
||||
_="on click or keyup[key is 'Enter']
|
||||
writeText('@{{ identity.handle }}') into the navigator's clipboard
|
||||
then add .copied
|
||||
wait 2s
|
||||
then remove .copied">
|
||||
<i class="fa-solid fa-copy"></i>
|
||||
</a>
|
||||
</small>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
{% block settings_content %}
|
||||
<form action="." method="POST" enctype="multipart/form-data"
|
||||
_="on submit metadata.collectMetadataFields()">
|
||||
_="on submit metadata.collectMetadataFields()">
|
||||
{% csrf_token %}
|
||||
|
||||
<fieldset>
|
||||
|
|
|
@ -16,7 +16,6 @@ import users.models.password_reset
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0001_initial"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0002_identity_discoverable"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0003_identity_followers_etc"),
|
||||
]
|
||||
|
|
|
@ -9,7 +9,6 @@ import users.models.report
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0004_emoji_post_emojis"),
|
||||
("users", "0004_identity_admin_notes_identity_restriction_and_more"),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0005_report"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0006_identity_actor_type"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0007_remove_invite_email_invite_expires_invite_uses"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0008_follow_boosts"),
|
||||
]
|
||||
|
|
|
@ -8,7 +8,6 @@ import users.models.domain
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0009_state_and_post_indexes"),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0010_domain_state"),
|
||||
]
|
||||
|
|
|
@ -8,7 +8,6 @@ import users.models.block
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0011_announcement"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0012_block_states"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0013_stator_indexes"),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0012_in_reply_to_index"),
|
||||
("users", "0014_domain_notes"),
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("activities", "0012_in_reply_to_index"),
|
||||
("users", "0015_bookmark"),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0016_hashtagfollow"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0017_identity_featured_collection_uri"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0019_stator_next_change"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0020_alter_identity_local"),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("users", "0021_identity_aliases"),
|
||||
]
|
||||
|
|
|
@ -19,7 +19,6 @@ class NodeInfoUsage(BaseModel):
|
|||
|
||||
|
||||
class NodeInfo(BaseModel):
|
||||
|
||||
version: Literal["2.0"]
|
||||
software: NodeInfoSoftware
|
||||
protocols: list[str] | None
|
||||
|
|
|
@ -9,7 +9,6 @@ from users.views.admin.generic import HTMXActionView
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class AnnouncementsRoot(ListView):
|
||||
|
||||
template_name = "admin/announcements.html"
|
||||
paginate_by = 30
|
||||
|
||||
|
@ -26,7 +25,6 @@ class AnnouncementsRoot(ListView):
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class AnnouncementCreate(CreateView):
|
||||
|
||||
model = Announcement
|
||||
template_name = "admin/announcement_create.html"
|
||||
extra_context = {"section": "announcements"}
|
||||
|
@ -45,7 +43,6 @@ class AnnouncementCreate(CreateView):
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class AnnouncementEdit(UpdateView):
|
||||
|
||||
model = Announcement
|
||||
template_name = "admin/announcement_edit.html"
|
||||
extra_context = {"section": "announcements"}
|
||||
|
@ -61,7 +58,6 @@ class AnnouncementEdit(UpdateView):
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class AnnouncementDelete(DeleteView):
|
||||
|
||||
model = Announcement
|
||||
template_name = "admin/announcement_delete.html"
|
||||
success_url = Announcement.urls.admin_root
|
||||
|
|
|
@ -35,7 +35,6 @@ class DomainValidator(RegexValidator):
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class Domains(TemplateView):
|
||||
|
||||
template_name = "admin/domains.html"
|
||||
|
||||
def get_context_data(self):
|
||||
|
@ -47,7 +46,6 @@ class Domains(TemplateView):
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class DomainCreate(FormView):
|
||||
|
||||
template_name = "admin/domain_create.html"
|
||||
extra_context = {"section": "domains"}
|
||||
|
||||
|
@ -156,7 +154,6 @@ class DomainCreate(FormView):
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class DomainEdit(FormView):
|
||||
|
||||
template_name = "admin/domain_edit.html"
|
||||
extra_context = {"section": "domains"}
|
||||
|
||||
|
@ -250,7 +247,6 @@ class DomainEdit(FormView):
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class DomainDelete(TemplateView):
|
||||
|
||||
template_name = "admin/domain_delete.html"
|
||||
|
||||
def dispatch(self, request, domain):
|
||||
|
|
|
@ -13,7 +13,6 @@ from users.views.admin.generic import HTMXActionView
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class EmojiRoot(ListView):
|
||||
|
||||
template_name = "admin/emoji.html"
|
||||
paginate_by = 50
|
||||
|
||||
|
@ -41,7 +40,6 @@ class EmojiRoot(ListView):
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class EmojiCreate(FormView):
|
||||
|
||||
template_name = "admin/emoji_create.html"
|
||||
extra_context = {"section": "emoji"}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ from users.decorators import moderator_required
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class Hashtags(ListView):
|
||||
|
||||
template_name = "admin/hashtags.html"
|
||||
paginate_by = 30
|
||||
|
||||
|
@ -26,7 +25,6 @@ class Hashtags(ListView):
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class HashtagEdit(FormView):
|
||||
|
||||
template_name = "admin/hashtag_edit.html"
|
||||
extra_context = {"section": "hashtags"}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ from users.models import Identity, IdentityStates
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class IdentitiesRoot(ListView):
|
||||
|
||||
template_name = "admin/identities.html"
|
||||
paginate_by = 30
|
||||
|
||||
|
@ -51,7 +50,6 @@ class IdentitiesRoot(ListView):
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class IdentityEdit(FormView):
|
||||
|
||||
template_name = "admin/identity_edit.html"
|
||||
extra_context = {
|
||||
"section": "identities",
|
||||
|
|
|
@ -13,7 +13,6 @@ from users.models import Invite
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class InvitesRoot(ListView):
|
||||
|
||||
template_name = "admin/invites.html"
|
||||
paginate_by = 30
|
||||
|
||||
|
@ -29,7 +28,6 @@ class InvitesRoot(ListView):
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class InviteCreate(FormView):
|
||||
|
||||
template_name = "admin/invite_create.html"
|
||||
extra_context = {
|
||||
"section": "invites",
|
||||
|
@ -65,7 +63,6 @@ class InviteCreate(FormView):
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class InviteView(FormView):
|
||||
|
||||
template_name = "admin/invite_view.html"
|
||||
extra_context = {
|
||||
"section": "invites",
|
||||
|
|
|
@ -10,7 +10,6 @@ from users.models import Identity, Report
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class ReportsRoot(ListView):
|
||||
|
||||
template_name = "admin/reports.html"
|
||||
paginate_by = 30
|
||||
|
||||
|
@ -34,7 +33,6 @@ class ReportsRoot(ListView):
|
|||
|
||||
@method_decorator(moderator_required, name="dispatch")
|
||||
class ReportView(FormView):
|
||||
|
||||
template_name = "admin/report_view.html"
|
||||
extra_context = {
|
||||
"section": "reports",
|
||||
|
|
|
@ -24,7 +24,6 @@ class AdminSettingsPage(SettingsPage):
|
|||
|
||||
|
||||
class BasicSettings(AdminSettingsPage):
|
||||
|
||||
section = "basic"
|
||||
|
||||
options = {
|
||||
|
@ -155,7 +154,6 @@ cache_field_defaults = {
|
|||
|
||||
|
||||
class TuningSettings(AdminSettingsPage):
|
||||
|
||||
section = "tuning"
|
||||
|
||||
options = {
|
||||
|
@ -196,7 +194,6 @@ class TuningSettings(AdminSettingsPage):
|
|||
|
||||
|
||||
class PoliciesSettings(AdminSettingsPage):
|
||||
|
||||
section = "policies"
|
||||
|
||||
options = {
|
||||
|
|
|
@ -7,7 +7,6 @@ from users.decorators import admin_required
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class Stator(TemplateView):
|
||||
|
||||
template_name = "admin/stator.html"
|
||||
|
||||
def get_context_data(self):
|
||||
|
|
|
@ -10,7 +10,6 @@ from users.models import User
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class UsersRoot(ListView):
|
||||
|
||||
template_name = "admin/users.html"
|
||||
paginate_by = 30
|
||||
|
||||
|
@ -33,7 +32,6 @@ class UsersRoot(ListView):
|
|||
|
||||
@method_decorator(admin_required, name="dispatch")
|
||||
class UserEdit(FormView):
|
||||
|
||||
template_name = "admin/user_edit.html"
|
||||
extra_context = {
|
||||
"section": "users",
|
||||
|
|
|
@ -29,11 +29,9 @@ class Logout(LogoutView):
|
|||
|
||||
|
||||
class Signup(FormView):
|
||||
|
||||
template_name = "auth/signup.html"
|
||||
|
||||
class form_class(forms.Form):
|
||||
|
||||
email = forms.EmailField(
|
||||
help_text="We will send a link to this email to create your account.",
|
||||
)
|
||||
|
@ -126,11 +124,9 @@ class Signup(FormView):
|
|||
|
||||
|
||||
class TriggerReset(FormView):
|
||||
|
||||
template_name = "auth/trigger_reset.html"
|
||||
|
||||
class form_class(forms.Form):
|
||||
|
||||
email = forms.EmailField(
|
||||
help_text="We will send a reset link to this email",
|
||||
)
|
||||
|
@ -155,11 +151,9 @@ class TriggerReset(FormView):
|
|||
|
||||
|
||||
class PerformReset(FormView):
|
||||
|
||||
template_name = "auth/perform_reset.html"
|
||||
|
||||
class form_class(forms.Form):
|
||||
|
||||
password = forms.CharField(
|
||||
widget=forms.PasswordInput,
|
||||
help_text="Must be at least 8 characters, and contain both letters and numbers.",
|
||||
|
|
|
@ -7,7 +7,6 @@ from users.views.base import IdentityViewMixin
|
|||
|
||||
|
||||
class DeleteIdentity(IdentityViewMixin, FormView):
|
||||
|
||||
template_name = "settings/delete.html"
|
||||
extra_context = {"section": "delete"}
|
||||
|
||||
|
|
|
@ -103,9 +103,9 @@ class CsvView(IdentityViewMixin, View):
|
|||
else:
|
||||
raise ValueError(f"Cannot export attribute {attrname}")
|
||||
# Make it into CSV format
|
||||
if type(value) == bool:
|
||||
if isinstance(value, bool):
|
||||
value = "true" if value else "false"
|
||||
elif type(value) == int:
|
||||
elif isinstance(value, int):
|
||||
value = str(value)
|
||||
row.append(value)
|
||||
writer.writerow(row)
|
||||
|
|
|
@ -61,7 +61,6 @@ class TokenCreate(IdentityViewMixin, FormView):
|
|||
|
||||
|
||||
class TokenEdit(IdentityViewMixin, DetailView):
|
||||
|
||||
template_name = "settings/token_edit.html"
|
||||
extra_context = {"section": "tokens"}
|
||||
|
||||
|
|
Loading…
Reference in New Issue