mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-25 10:34:21 +00:00
fix merging
This commit is contained in:
parent
69c95cfd37
commit
9447de4468
@ -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():
|
||||
|
@ -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
|
||||
|
@ -43,4 +43,3 @@ urlpatterns = [
|
||||
url(r'^membership/(?P<membership_id>[0-9]+)/edit$', UserTrombiEditMembershipView.as_view(), name='edit_membership'),
|
||||
url(r'^membership/(?P<membership_id>[0-9]+)/delete$', UserTrombiDeleteMembershipView.as_view(), name='delete_membership'),
|
||||
]
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user