1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00

remove trailing whitespace and add docstrings

This commit is contained in:
Pierre-antoine Comby 2019-09-23 12:54:08 +02:00
parent 075995ce73
commit e2d32b11e2

View File

@ -27,8 +27,8 @@ from note.tables import HistoryTable
class UserCreateView(CreateView):
"""
Une vue pour inscrire un utilisateur et lui créer un profile
"""
form_class = ProfileForm
success_url = reverse_lazy('login')
template_name ='member/signup.html'
@ -49,14 +49,15 @@ class UserCreateView(CreateView):
user_profile.save()
return super().form_valid(form)
class UserDetailView(LoginRequiredMixin,DetailView):
"""
Affiche les informations sur un utilisateur, sa note, ses clubs ...
"""
model = Profile
context_object_name = "profile"
def get_context_data(slef,**kwargs):
context = super().get_context_data(**kwargs)
user = context['profile'].user
history_list = \
Transaction.objects.all().filter(Q(source=user.note) | Q(destination=user.note))
context['history_list'] = HistoryTable(history_list)
@ -66,6 +67,9 @@ class UserDetailView(LoginRequiredMixin,DetailView):
return context
class UserListView(LoginRequiredMixin,SingleTableView):
"""
Affiche la liste des utilisateurs, avec une fonction de recherche statique
"""
model = User
table_class = UserTable
template_name = 'member/user_list.html'
@ -100,7 +104,7 @@ class ClubCreateView(LoginRequiredMixin,CreateView):
class ClubListView(LoginRequiredMixin,SingleTableView):
"""
List existing tables
List existing Clubs
"""
model = Club
table_class = ClubTable