def _can_download_report(user):
 try:
  access_group = Group.objects.get(name=settings.PAYMENT_REPORT_GENERATOR_GROUP)
 except Group.DoesNotExist:
  return False
 return (access_group in user.groups.all())

def _can_download_report ( user ) : try : access_group = Group . objects . get ( name = settings . PAYMENT_REPORT_GENERATOR_GROUP ) except Group . DoesNotExist : return False return ( access_group in user . groups . all ( ) )
tests if the user can download the payments report .