Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shtayeb committed Dec 18, 2024
1 parent 804a6da commit bc08dfc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/project_reports/exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def org_5w_dashboard_export(request, code):
return response
except Exception as e:
print(f"Error: {e}")
return HttpResponse(status=500,content=e)
return HttpResponse(status=500, content=e)


# export monthly report for single project
Expand Down
8 changes: 2 additions & 6 deletions src/project_reports/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,8 @@ def write_projects_reports_to_csv(monthly_progress_report, response):
)
if project_reports.project.clusters
else None,
project_reports.project.user.first_name
if project_reports.project.user.first_name
else None,
project_reports.project.user.profile.phone
if project_reports.project.user.profile
else None,
project_reports.project.user.first_name if project_reports.project.user.first_name else None,
project_reports.project.user.profile.phone if project_reports.project.user.profile else None,
project_reports.project.user.email if project_reports.project.user else None,
project_reports.project.user.profile.organization.code
if project_reports.project.user.profile
Expand Down
4 changes: 1 addition & 3 deletions src/project_reports/views/dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@
def cluster_5w_dashboard(request, cluster):
cluster = get_object_or_404(Cluster, code=cluster)



if not is_cluster_lead(
user=request.user,
clusters=[
cluster.code,
],
):
raise PermissionDenied

user_country = request.user.profile.country
filter_params = {
"project__clusters__in": [cluster],
Expand Down
6 changes: 1 addition & 5 deletions src/users/views/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,7 @@ def export_organization_users(request):
user_org = request.user.profile.organization
try:
# get the filtered queryset
users_list = (
User.objects.filter(profile__organization=user_org)
.select_related("profile")
.order_by("-id")
)
users_list = User.objects.filter(profile__organization=user_org).select_related("profile").order_by("-id")
if request.GET:
users_filter = UsersFilter(
request.GET,
Expand Down

0 comments on commit bc08dfc

Please sign in to comment.