removing unused code

This commit is contained in:
Élie Bouttier 2017-11-05 16:38:35 +01:00
parent 714b85594e
commit bac3953763
1 changed files with 1 additions and 18 deletions

View File

@ -1,10 +1,6 @@
from django.utils.crypto import get_random_string
from django.db.models import Q, Sum
from django.db.models import Sum
from django.db.models.functions import Coalesce
from django.utils.safestring import mark_safe
from markdown import markdown
import bleach
def query_sum(queryset, field):
@ -14,19 +10,6 @@ def query_sum(queryset, field):
def generate_user_uid():
return get_random_string(length=12, allowed_chars='abcdefghijklmnopqrstuvwxyz0123456789')
def allowed_talks(talks, request):
if not Participation.objects.get(site=request.conference.site, user=request.user).is_orga():
talks = talks.filter(Q(topics__reviewers=request.user) | Q(speakers=request.user) | Q(proposer=request.user))
return talks.distinct()
def markdown_to_html(md):
html = markdown(md)
allowed_tags = bleach.ALLOWED_TAGS + ['p', 'pre', 'span' ] + ['h%d' % i for i in range(1, 7) ]
html = bleach.clean(html, tags=allowed_tags)
return mark_safe(html)
def is_staff(request, user):
return user.is_authenticated and (user.is_superuser or request.conference.staff.filter(pk=user.pk).exists())