mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 04:20:17 +02:00
precommit
This commit is contained in:
parent
15fc38ccfd
commit
9547826272
@ -24,16 +24,22 @@ exclude: |
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.8.1
|
||||
rev: v0.9.9
|
||||
hooks:
|
||||
# Run the linter, and only the linter
|
||||
- id: ruff
|
||||
|
||||
- repo: https://github.com/adamchainz/django-upgrade
|
||||
rev: 1.22.2
|
||||
rev: 1.23.1
|
||||
hooks:
|
||||
- id: django-upgrade
|
||||
args: [--target-version=4.2]
|
||||
args: [--target-version=5.1]
|
||||
|
||||
- repo: https://github.com/asottile/pyupgrade # Ruff doesnt get everything.
|
||||
rev: v3.19.1
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py310-plus]
|
||||
|
||||
# Formatting
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
|
@ -126,7 +126,7 @@ class UserProfile(models.Model):
|
||||
self.save(update_fields=['state'])
|
||||
notify(
|
||||
self.user,
|
||||
_('State changed to: {}'.format(state)),
|
||||
_(f'State changed to: {state}'),
|
||||
_('Your user\'s state is now: %(state)s')
|
||||
% ({'state': state}),
|
||||
'info'
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
from django.db.models.signals import post_save
|
||||
from django.test.testcases import TestCase
|
||||
|
||||
|
@ -175,9 +175,9 @@ def add_character(request, token):
|
||||
if CharacterOwnership.objects.filter(character__character_id=token.character_id).filter(
|
||||
owner_hash=token.character_owner_hash).filter(user=request.user).exists():
|
||||
messages.success(request, _(
|
||||
'Added {name} to your account.'.format(name=token.character_name)))
|
||||
f'Added {token.character_name} to your account.'))
|
||||
else:
|
||||
messages.error(request, _('Failed to add {name} to your account: they already have an account.'.format(name=token.character_name)))
|
||||
messages.error(request, _(f'Failed to add {token.character_name} to your account: they already have an account.'))
|
||||
return redirect('authentication:dashboard')
|
||||
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.db import models
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
|
||||
|
@ -112,7 +112,7 @@ def jabber_broadcast_view(request):
|
||||
|
||||
OpenfireManager.send_broadcast_message(group_to_send, message_to_send)
|
||||
|
||||
messages.success(request, _('Sent Jabber broadcast to {}'.format(group_to_send)))
|
||||
messages.success(request, _(f'Sent Jabber broadcast to {group_to_send}'))
|
||||
logger.info(f"Sent Jabber broadcast on behalf of user {request.user}")
|
||||
except PingBotException as e:
|
||||
messages.error(request, e)
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
from django.contrib.auth.models import Group, Permission, User
|
||||
from django.db.models.signals import m2m_changed, post_save, pre_save
|
||||
from django.test import TestCase
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
from django.contrib.auth.models import Group, Permission, User
|
||||
from django.test import TestCase
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
class ThemeHook:
|
||||
"""
|
||||
Theme hook for injecting a Bootstrap 5 Theme and associated JS into alliance auth.
|
||||
|
Loading…
x
Reference in New Issue
Block a user