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