Skip to content

Commit

Permalink
enable admins to delete users with assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
cash committed Apr 10, 2023
1 parent c1a4409 commit eccb94b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion turkle/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1258,14 +1258,18 @@ def has_delete_permission(self, request, obj=None):
return False


class TaskAssignmentAdmin(ViewOnlyAdminMixin, admin.ModelAdmin):
class TaskAssignmentAdmin(admin.ModelAdmin):
"""View for assignments to expire abandoned ones"""

class Media:
css = {
'all': ('turkle/css/admin-turkle.css',),
}

# this turns off the add button in admin sidebar for task assignments
def has_add_permission(self, request):
return False

def changelist_view(self, request, extra_context=None):
num_incomplete_tasks = TaskAssignment.objects.\
filter(completed=False).\
Expand Down

0 comments on commit eccb94b

Please sign in to comment.