Commit eaa33022 authored by Jomaro Rodrigues's avatar Jomaro Rodrigues
Browse files

Adicionadas ações para aceitar e recusar requisições de acesso ao sistema

parent ddc6ab74
No related merge requests found
Showing with 21 additions and 0 deletions
+21 -0
# coding: utf-8
from django.contrib import admin
from public.models import Request
......@@ -7,5 +9,18 @@ class RequestAdmin(admin.ModelAdmin):
list_display = ('name', 'email', 'status', 'courses_as_str')
list_filter = ('status', )
actions = ['accept', 'deny']
def accept(self, request, queryset):
for _request in queryset:
_request.accept()
def deny(self, request, queryset):
for _request in queryset:
_request.deny()
accept.short_description = "Aceitar as requisições selecionadas"
deny.short_description = "recusar as requisições selecionadas"
admin.site.register(Request, RequestAdmin)
\ No newline at end of file
......@@ -8,5 +8,11 @@
<h1>Sua requisição de acesso ao sistema ADEGA foi aprovada.</h1>
<h3>Seus dados de acesso são:</h3>
<p>Email: {{ user.email }}</p>
<p>Senha: {{ passwd }}</p>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment