diff --git a/sas/views.py b/sas/views.py index e50479cd..1dc5b202 100644 --- a/sas/views.py +++ b/sas/views.py @@ -25,6 +25,7 @@ from django.shortcuts import redirect from django.http import HttpResponse from django.core.urlresolvers import reverse_lazy, reverse +from core.views.forms import SelectDate from django.views.generic import DetailView, TemplateView from django.views.generic.edit import UpdateView, FormMixin, FormView from django.utils.translation import ugettext_lazy as _ @@ -130,7 +131,7 @@ class PictureView(CanViewMixin, DetailView, FormMixin): try: user = User.objects.filter(id=int(request.GET['remove_user'])).first() if user.id == request.user.id or request.user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID): - r = PeoplePictureRelation.objects.filter(user=user, picture=self.object).delete() + PeoplePictureRelation.objects.filter(user=user, picture=self.object).delete() except: pass if 'ask_removal' in request.GET.keys(): diff --git a/trombi/models.py b/trombi/models.py index 1b53a34c..c7533560 100644 --- a/trombi/models.py +++ b/trombi/models.py @@ -117,12 +117,12 @@ class TrombiUser(models.Model): else: end_date = "" TrombiClubMembership( - user=self, - club=str(m.club), - role=role[:64], - start=get_semester(m.start_date), - end=end_date, - ).save() + user=self, + club=str(m.club), + role=role[:64], + start=get_semester(m.start_date), + end=end_date, + ).save() class TrombiComment(models.Model): @@ -140,6 +140,7 @@ class TrombiComment(models.Model): return False return user.id == self.author.user.id or user.can_edit(self.author.trombi) + class TrombiClubMembership(models.Model): """ This represent a membership to a club diff --git a/trombi/urls.py b/trombi/urls.py index 90928663..d1a44b92 100644 --- a/trombi/urls.py +++ b/trombi/urls.py @@ -43,4 +43,3 @@ urlpatterns = [ url(r'^membership/(?P[0-9]+)/edit$', UserTrombiEditMembershipView.as_view(), name='edit_membership'), url(r'^membership/(?P[0-9]+)/delete$', UserTrombiDeleteMembershipView.as_view(), name='delete_membership'), ] - diff --git a/trombi/views.py b/trombi/views.py index afd6b52d..24f4349a 100644 --- a/trombi/views.py +++ b/trombi/views.py @@ -24,9 +24,9 @@ from django.http import Http404 from django.shortcuts import get_object_or_404, redirect -from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse_lazy, reverse from django.views.generic import DetailView, RedirectView, TemplateView -from django.views.generic.edit import UpdateView, CreateView +from django.views.generic.edit import UpdateView, CreateView, DeleteView from django.utils.translation import ugettext_lazy as _ from django import forms from django.conf import settings @@ -50,17 +50,17 @@ class TrombiTabsMixin(TabedViewMixin): tab_list.append({ 'url': reverse('trombi:user_tools'), 'slug': 'tools', - 'name': _("Tools"), + 'name': _("Tools"), }) tab_list.append({ 'url': reverse('trombi:profile'), 'slug': 'profile', - 'name': _("My profile"), + 'name': _("My profile"), }) tab_list.append({ 'url': reverse('trombi:pictures'), 'slug': 'pictures', - 'name': _("My pictures"), + 'name': _("My pictures"), }) try: trombi = self.request.user.trombi_user.trombi @@ -254,10 +254,11 @@ class UserTrombiEditProfileView(QuickNotifMixin, TrombiTabsMixin, UpdateView): form_class = modelform_factory(User, fields=['second_email', 'phone', 'department', 'dpt_option', 'quote', 'parent_address'], - labels={'second_email': _("Personal email (not UTBM)"), - 'phone': _("Phone"), - 'parent_address': _("Native town"), - }) + labels={ + 'second_email': _("Personal email (not UTBM)"), + 'phone': _("Phone"), + 'parent_address': _("Native town"), + }) template_name = "trombi/edit_profile.jinja" current_tab = "profile"