Mise à jour de Black vers la version 23.3 (#629)

This commit is contained in:
thomas girod 2023-04-22 15:32:31 +02:00 committed by GitHub
parent c78953b036
commit b5a40cfda9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
135 changed files with 37 additions and 154 deletions

View File

@ -77,7 +77,7 @@ jobs:
- name: Install black
run: |
python -m pip install --upgrade pip
python -m pip install black==22.6.0
python -m pip install black==23.3.0
- name: Check linting
run: black --check .

View File

@ -8,7 +8,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = []
operations = [

View File

@ -6,7 +6,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("club", "0001_initial"),
("accounting", "0001_initial"),

View File

@ -6,7 +6,6 @@ import phonenumber_field.modelfields
class Migration(migrations.Migration):
dependencies = [("accounting", "0002_auto_20160824_2152")]
operations = [

View File

@ -6,7 +6,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("accounting", "0003_auto_20160824_2203")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("accounting", "0004_auto_20161005_1505")]
operations = [

View File

@ -24,7 +24,6 @@ from api.views import RightModelViewSet
class CounterSerializer(serializers.ModelSerializer):
is_open = serializers.BooleanField(read_only=True)
barman_list = serializers.ListField(
child=serializers.IntegerField(), read_only=True

View File

@ -24,7 +24,6 @@ from api.views import RightModelViewSet
class LaunderettePlaceSerializer(serializers.ModelSerializer):
machine_list = serializers.ListField(
child=serializers.IntegerField(), read_only=True
)

View File

@ -167,7 +167,6 @@ class SellingsForm(forms.Form):
)
def __init__(self, club, *args, **kwargs):
super(SellingsForm, self).__init__(*args, **kwargs)
self.fields["products"] = forms.ModelMultipleChoiceField(
club.products.order_by("name").filter(archived=False).all(),

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = []
operations = [

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("club", "0001_initial"),

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("club", "0002_auto_20160824_2152")]
operations = [

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("club", "0003_auto_20160902_2042")]
operations = [

View File

@ -6,7 +6,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("club", "0004_auto_20160915_1057")]
operations = [

View File

@ -6,7 +6,6 @@ import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [("club", "0005_auto_20161120_1149")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("club", "0006_auto_20161229_0040")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("club", "0007_auto_20170324_0917")]
operations = [

View File

@ -9,7 +9,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("club", "0008_auto_20170515_2214"),

View File

@ -19,7 +19,6 @@ def generate_club_pages(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("core", "0024_auto_20170906_1317"), ("club", "0010_club_logo")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("club", "0009_auto_20170822_2232")]
operations = [

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("club", "0010_auto_20170912_2028")]
operations = [

View File

@ -72,6 +72,7 @@ class Club(models.Model):
_("short description"), max_length=1000, default="", blank=True, null=True
)
address = models.CharField(_("address"), max_length=254)
# This function prevents generating migration upon settings change
def get_default_owner_group():
return settings.SITH_GROUP_ROOT_ID

View File

@ -443,7 +443,6 @@ class ClubSellingCSVView(ClubSellingView):
return row
def get(self, request, *args, **kwargs):
self.object = self.get_object()
kwargs = self.get_context_data(**kwargs)
@ -706,7 +705,6 @@ class ClubMailingView(ClubTabsMixin, CanEditMixin, DetailFormView):
class MailingDeleteView(CanEditMixin, DeleteView):
model = Mailing
template_name = "core/delete_confirm.jinja"
pk_url_kwarg = "mailing_id"
@ -724,7 +722,6 @@ class MailingDeleteView(CanEditMixin, DeleteView):
class MailingSubscriptionDeleteView(CanEditMixin, DeleteView):
model = MailingSubscription
template_name = "core/delete_confirm.jinja"
pk_url_kwarg = "mailing_subscription_id"

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("club", "0005_auto_20161120_1149"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("club", "0006_auto_20161229_0040"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),

View File

@ -8,7 +8,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("club", "0010_auto_20170912_2028"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("com", "0004_auto_20171221_1614")]
operations = [

View File

@ -6,7 +6,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("com", "0005_auto_20180318_2227")]
operations = [migrations.RemoveField(model_name="sith", name="index_page")]

View File

@ -39,6 +39,5 @@ class Command(compilemessages.Command):
"""
def handle(self, *args, **options):
os.chdir("sith")
super(Command, self).handle(*args, **options)

View File

@ -60,7 +60,7 @@ class Command(BaseCommand):
def compilescss(self, file):
print("compiling %s" % file)
with (open(file.replace(".scss", ".css"), "w")) as newfile:
with open(file.replace(".scss", ".css"), "w") as newfile:
newfile.write(self.compile(file))
def removescss(self, file):
@ -68,7 +68,6 @@ class Command(BaseCommand):
os.remove(file)
def handle(self, *args, **options):
if os.path.isdir(settings.STATIC_ROOT):
print("---- Compiling scss files ---")
self.exec_on_folder(settings.STATIC_ROOT, self.compilescss)

View File

@ -12,7 +12,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("auth", "0006_require_contenttypes_0002")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0001_initial")]
operations = [

View File

@ -6,7 +6,6 @@ import django.core.validators
class Migration(migrations.Migration):
dependencies = [("core", "0002_auto_20160831_0144")]
operations = [

View File

@ -6,7 +6,6 @@ from django.conf import settings
class Migration(migrations.Migration):
dependencies = [("core", "0003_auto_20160902_1914")]
operations = [

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("core", "0004_user_godfathers")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0005_auto_20161105_1035")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0006_auto_20161108_1703")]
operations = [

View File

@ -7,7 +7,6 @@ import core.models
class Migration(migrations.Migration):
dependencies = [("core", "0008_sithfile_asked_for_removal")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0009_auto_20161120_1155")]
operations = [

View File

@ -7,7 +7,6 @@ import core.models
class Migration(migrations.Migration):
dependencies = [("core", "0010_sithfile_is_in_sas")]
operations = [

View File

@ -8,7 +8,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("core", "0011_auto_20161124_0848")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0012_notification")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0013_auto_20161209_2338")]
operations = [

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("core", "0014_auto_20161210_0009")]
operations = [

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("core", "0015_sithfile_moderator")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0016_auto_20161212_1922")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0017_auto_20161220_1626")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0018_auto_20161224_0211")]
operations = [

View File

@ -6,7 +6,6 @@ import django.core.validators
class Migration(migrations.Migration):
dependencies = [("core", "0019_preferences_receive_weekmail")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0020_auto_20170324_0917")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0021_auto_20170822_1529")]
operations = [

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("core", "0022_auto_20170822_2232")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0023_auto_20170902_1226")]
operations = [

View File

@ -6,7 +6,6 @@ import django.core.validators
class Migration(migrations.Migration):
dependencies = [("core", "0024_auto_20170906_1317")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0025_auto_20170919_1521")]
operations = [

View File

@ -8,7 +8,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("core", "0026_auto_20170926_1512")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0027_gift")]
operations = [

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("core", "0028_auto_20171216_2044")]
operations = [

View File

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0029_auto_20180426_2013")]
operations = [

View File

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0030_auto_20190704_1500")]
operations = [

View File

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0031_auto_20190906_1615")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("core", "0032_auto_20190909_0043")]
operations = [

View File

@ -6,7 +6,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("core", "0033_auto_20191006_0049"),
]

View File

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("core", "0034_operationlog"),
]

View File

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0035_auto_20200216_1743")]
operations = [

View File

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0036_auto_20211001_0248")]
operations = [

View File

@ -1176,6 +1176,7 @@ class Page(models.Model):
# Attention: this field may not be valid until you call save(). It's made for fast query, but don't rely on it when
# playing with a Page object, use get_full_name() instead!
_full_name = models.CharField(_("page name"), max_length=255, blank=True)
# This function prevents generating migration upon settings change
def get_default_owner_group():
return settings.SITH_GROUP_ROOT_ID

View File

@ -162,7 +162,6 @@ class GenericContentPermissionMixinBuilder(View):
return cls.permission_function(obj, user)
def dispatch(self, request, *arg, **kwargs):
if hasattr(self, "get_object") and callable(self.get_object):
self.object = self.get_object()
if not self.get_permission_function(self.object, request.user):

View File

@ -413,6 +413,7 @@ class UserGodfathersTreePictureView(CanViewMixin, DetailView):
self.graph = pgv.AGraph(strict=False, directed=True)
family = set()
self.level = 1
# Since the tree isn't very deep, we can build it recursively
def crawl_family(user):
if self.level > self.depth:

View File

@ -9,7 +9,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("subscription", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),

View File

@ -8,7 +8,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("counter", "0001_initial"),

View File

@ -7,7 +7,6 @@ from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [("counter", "0002_auto_20160826_1342")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("counter", "0003_permanency_activity")]
operations = [

View File

@ -6,7 +6,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("counter", "0004_auto_20160826_1907")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("counter", "0005_auto_20160826_2330")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("counter", "0006_auto_20160831_1304")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("counter", "0007_product_archived")]
operations = [

View File

@ -6,7 +6,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("counter", "0008_counter_token")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("counter", "0009_eticket")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("counter", "0010_auto_20161003_1900")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("counter", "0011_auto_20161004_2039")]
operations = [

View File

@ -37,7 +37,6 @@ def balance_ecocups(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("counter", "0012_auto_20170515_2202")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("counter", "0013_customer_recorded_products")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("counter", "0013_customer_recorded_products")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("counter", "0014_auto_20170817_1537"),
("counter", "0014_auto_20170816_1521"),

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("counter", "0015_merge")]
operations = [

View File

@ -8,7 +8,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("counter", "0016_producttype_comment")]
operations = [

View File

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("counter", "0017_studentcard"),
]

View File

@ -6,7 +6,6 @@ import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
("counter", "0018_producttype_priority"),
]

View File

@ -5,7 +5,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("counter", "0019_billinginfo"),
]

View File

@ -8,7 +8,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
operations = [

View File

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("eboutic", "0001_initial"),
]

View File

@ -7,7 +7,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("core", "0018_auto_20161224_0211"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("election", "0001_initial")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("election", "0002_election_archived")]
operations = [

View File

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("election", "0003_auto_20171202_1819")]
operations = [

View File

@ -10,7 +10,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("club", "0006_auto_20161229_0040"),

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("forum", "0001_initial")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("forum", "0002_auto_20170312_1753")]
operations = [

Some files were not shown because too many files have changed in this diff Show More