mirror of
https://github.com/pretix/pretix.git
synced 2026-08-28 13:34:40 +00:00
Resolve warnings from modern flake8
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ install:
|
|||||||
before_script:
|
before_script:
|
||||||
- cd src
|
- cd src
|
||||||
script:
|
script:
|
||||||
- flake8 --ignore=E123,F403,F401,N802,C901,W503 .
|
- flake8 --ignore=E123,F403,F401,N802,C901,W503,E402 .
|
||||||
- isort -c -rc .
|
- isort -c -rc .
|
||||||
- python manage.py check
|
- python manage.py check
|
||||||
- make
|
- make
|
||||||
|
|||||||
@@ -22,4 +22,6 @@ if settings.HAS_CELERY:
|
|||||||
from pretix.celery import app
|
from pretix.celery import app
|
||||||
|
|
||||||
export_task = app.task(export)
|
export_task = app.task(export)
|
||||||
export = lambda *args, **kwargs: export_task.apply_async(args=args, kwargs=kwargs)
|
|
||||||
|
def export(*args, **kwargs):
|
||||||
|
export_task.apply_async(args=args, kwargs=kwargs)
|
||||||
|
|||||||
@@ -90,4 +90,6 @@ if settings.HAS_CELERY and settings.EMAIL_BACKEND != 'django.core.mail.outbox':
|
|||||||
from pretix.celery import app
|
from pretix.celery import app
|
||||||
|
|
||||||
mail_send_task = app.task(mail_send)
|
mail_send_task = app.task(mail_send)
|
||||||
mail_send = lambda *args, **kwargs: mail_send_task.apply_async(args=args, kwargs=kwargs)
|
|
||||||
|
def mail_send(*args, **kwargs):
|
||||||
|
mail_send_task.apply_async(args=args, kwargs=kwargs)
|
||||||
|
|||||||
@@ -32,4 +32,6 @@ if settings.HAS_CELERY:
|
|||||||
from pretix.celery import app
|
from pretix.celery import app
|
||||||
|
|
||||||
generate_task = app.task(generate)
|
generate_task = app.task(generate)
|
||||||
generate = lambda *args, **kwargs: generate_task.apply_async(args=args, kwargs=kwargs)
|
|
||||||
|
def generate(*args, **kwargs):
|
||||||
|
generate_task.apply_async(args=args, kwargs=kwargs)
|
||||||
|
|||||||
@@ -8,12 +8,15 @@ register = template.Library()
|
|||||||
|
|
||||||
@register.filter(name='togglesum', needs_autoescape=True)
|
@register.filter(name='togglesum', needs_autoescape=True)
|
||||||
def cut(value, autoescape=True):
|
def cut(value, autoescape=True):
|
||||||
|
def noop(x):
|
||||||
|
return x
|
||||||
|
|
||||||
if not value:
|
if not value:
|
||||||
return ''
|
return ''
|
||||||
if autoescape:
|
if autoescape:
|
||||||
esc = conditional_escape
|
esc = conditional_escape
|
||||||
else:
|
else:
|
||||||
esc = lambda x: x
|
esc = noop
|
||||||
return mark_safe('<span class="count">{0}</span><span class="sum">{1}</span>'.format(
|
return mark_safe('<span class="count">{0}</span><span class="sum">{1}</span>'.format(
|
||||||
esc(value[0]), esc(formats.localize(value[1]))
|
esc(value[0]), esc(formats.localize(value[1]))
|
||||||
))
|
))
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
[flake8]
|
[flake8]
|
||||||
ignore = N802,W503
|
ignore = N802,W503,E402
|
||||||
max-line-length = 160
|
max-line-length = 160
|
||||||
exclude = migrations,.ropeproject,static,mt940.py,_static
|
exclude = migrations,.ropeproject,static,mt940.py,_static,build,make_testdata.py
|
||||||
max-complexity = 11
|
max-complexity = 11
|
||||||
|
|
||||||
[isort]
|
[isort]
|
||||||
|
|||||||
Reference in New Issue
Block a user