2020-05-08 23:16:48 +02:00
|
|
|
from django.contrib.auth.decorators import permission_required
|
2020-05-08 19:06:51 +02:00
|
|
|
from django.contrib.auth.mixins import PermissionRequiredMixin
|
2020-05-08 23:16:48 +02:00
|
|
|
from django.http import HttpResponse
|
2019-12-21 19:55:07 +01:00
|
|
|
from django.views.generic import TemplateView
|
|
|
|
|
2020-05-08 23:16:48 +02:00
|
|
|
from bds.models import BDSProfile
|
|
|
|
|
2020-05-08 19:06:51 +02:00
|
|
|
|
|
|
|
class HomeView(PermissionRequiredMixin, TemplateView):
|
|
|
|
permission_required = "bds:is_team"
|
|
|
|
template_name = "bds/home.html"
|
|
|
|
|
|
|
|
|
|
|
|
home = HomeView.as_view()
|
2020-05-08 23:16:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
@permission_required("bds:is_staff")
|
|
|
|
def members_emails(request):
|
|
|
|
members = BDSProfile.objects.filter(is_member=True)
|
|
|
|
response = HttpResponse(content_type="text/plain")
|
|
|
|
response.write(", ".join(members.values_list("user__email", flat=True)))
|
|
|
|
return response
|