From 89f8ee7ccae844d94cd89c4eb037b90533026d28 Mon Sep 17 00:00:00 2001 From: chirac Date: Sat, 2 Jul 2016 21:17:21 +0200 Subject: [PATCH] =?UTF-8?q?Gestion=20compl=C3=A8te=20des=20cotisations,=20?= =?UTF-8?q?lorsque=20la=20facture=20concerne=20une=20cotisation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cotisations/__pycache__/admin.cpython-34.pyc | Bin 1182 -> 1632 bytes cotisations/__pycache__/models.cpython-34.pyc | Bin 3591 -> 4224 bytes cotisations/__pycache__/views.cpython-34.pyc | Bin 2267 -> 3376 bytes .../migrations/0010_auto_20160702_1840.py | 19 +++++++++++ .../migrations/0011_auto_20160702_1911.py | 19 +++++++++++ .../0010_auto_20160702_1840.cpython-34.pyc | Bin 0 -> 739 bytes .../0011_auto_20160702_1911.cpython-34.pyc | Bin 0 -> 661 bytes cotisations/models.py | 6 ++-- .../templates/cotisations/facture.html | 2 +- cotisations/views.py | 27 ++++++++++++++-- users/__pycache__/__init__.cpython-34.pyc | Bin 0 -> 114 bytes users/__pycache__/admin.cpython-34.pyc | Bin 0 -> 1197 bytes users/__pycache__/forms.cpython-34.pyc | Bin 0 -> 532 bytes users/__pycache__/models.cpython-34.pyc | Bin 0 -> 5640 bytes users/__pycache__/urls.cpython-34.pyc | Bin 0 -> 644 bytes users/__pycache__/views.cpython-34.pyc | Bin 0 -> 3792 bytes users/migrations/0003_listrights_rights.py | 30 ++++++++++++++++++ users/migrations/0004_auto_20160701_2312.py | 22 +++++++++++++ users/migrations/0005_auto_20160702_0006.py | 18 +++++++++++ .../__pycache__/0001_initial.cpython-34.pyc | Bin 0 -> 1367 bytes .../0002_auto_20160630_2301.cpython-34.pyc | Bin 0 -> 900 bytes .../0003_listrights_rights.cpython-34.pyc | Bin 0 -> 1088 bytes .../0004_auto_20160701_2312.cpython-34.pyc | Bin 0 -> 664 bytes .../0005_auto_20160702_0006.cpython-34.pyc | Bin 0 -> 654 bytes .../__pycache__/__init__.cpython-34.pyc | Bin 0 -> 125 bytes users/models.py | 1 + users/templates/users/index.html | 2 ++ 27 files changed, 140 insertions(+), 6 deletions(-) create mode 100644 cotisations/migrations/0010_auto_20160702_1840.py create mode 100644 cotisations/migrations/0011_auto_20160702_1911.py create mode 100644 cotisations/migrations/__pycache__/0010_auto_20160702_1840.cpython-34.pyc create mode 100644 cotisations/migrations/__pycache__/0011_auto_20160702_1911.cpython-34.pyc create mode 100644 users/__pycache__/__init__.cpython-34.pyc create mode 100644 users/__pycache__/admin.cpython-34.pyc create mode 100644 users/__pycache__/forms.cpython-34.pyc create mode 100644 users/__pycache__/models.cpython-34.pyc create mode 100644 users/__pycache__/urls.cpython-34.pyc create mode 100644 users/__pycache__/views.cpython-34.pyc create mode 100644 users/migrations/0003_listrights_rights.py create mode 100644 users/migrations/0004_auto_20160701_2312.py create mode 100644 users/migrations/0005_auto_20160702_0006.py create mode 100644 users/migrations/__pycache__/0001_initial.cpython-34.pyc create mode 100644 users/migrations/__pycache__/0002_auto_20160630_2301.cpython-34.pyc create mode 100644 users/migrations/__pycache__/0003_listrights_rights.cpython-34.pyc create mode 100644 users/migrations/__pycache__/0004_auto_20160701_2312.cpython-34.pyc create mode 100644 users/migrations/__pycache__/0005_auto_20160702_0006.cpython-34.pyc create mode 100644 users/migrations/__pycache__/__init__.cpython-34.pyc diff --git a/cotisations/__pycache__/admin.cpython-34.pyc b/cotisations/__pycache__/admin.cpython-34.pyc index a11e97072093a160772afeec761c1a8b4ec63781..49d9c42eec953b77da7bff9de19e2bf7edb4e952 100644 GIT binary patch literal 1632 zcmbVMOK;Oa5FW?RIL-qKh{BB%zBDRlgi?^`i3q6&Bws8yyHt++NY@UbzLr13U)n3D za^MGWVrK0mZb}bn9FJz_vHR^eGydcC-QPE>FULB-FKGP?)F=2B#~J{`zXl0FszIQE z#yY@sNIH<}5a^H^5Ezh}5SWl!5Ll4f5ZIudG6R?iKQP?{uEE@aYs~1vDYJmt%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uV)o;q}1aNB`#;T(v3K0gKBFbm?C^#(+;z6RD$5)2R}>+6>Fo?d=0&B__t zpJy2E&SnVyH*~%y!Ay>W3za+>4EAwubU4@FoL%# zfCj@!0z{=0T;njJQWCCIfT{dvXizQUi4y3_@y|*sX=%jLg(jU?ArKzsW5EL73Kp`+ zz>wGw{B=D~JPJ9a_^05Rdm)y_{Zj~|2q=_g5ip*eLnt8hu$B`tE<=q4x19ojIMiiMlC~TL;QXu z6BivJiZcxdCi(NoHU2~kNoTnfPqnQ8v1IZY5BK z-7gnhai-pSw$G=UzdHsZu?;8M2C?6Rn*u? zlne_+Wh2hN#}|e93>{+FlnnjcSA0lE%#f3>&q3uqo6bvcC%!WY39djQkdCFbw3=3j G`~Cwi()B_B diff --git a/cotisations/__pycache__/views.cpython-34.pyc b/cotisations/__pycache__/views.cpython-34.pyc index 2a66acfdf032f74f231e37ddac3477f46d0d5a94..c1fe5b1586a15a6d9690a1ea786d3dc1f27259d1 100644 GIT binary patch literal 3376 zcmb_ePjeed6@M*_{#cf5+0H6)lFiNni%}8mttAAiSeAvbfug`r>rE}pMKzvjJEP1W zrMt&=QqC!S0WO@m`oIU^>~GOmPF(l^ocO(NNwz~3CnQa)`}ONL-S7Q=@Abd>gWlga z&%Q4DME{^`p9cD${n`W~et*Z+Xh9vzHt|C3!dZrHYxWh#~JDw$?VCI+%i zFPoTZqNJWxrIvQ%Sei+7IEBWfQjxAEDyW!LuQ>C-qdwUSRORoL|}(#%{Jbmjxw`I$0Vl1tlrQkhK0 zCaX$*{WI-s50uOyJCUi(O}w8p`E2+Ec-nZL;L)F;IVXD4r1K_CiHxB02E7&h6Q)7u z7&jR$1{!{%Ar8ikeLGD2=_XmJOf-@3k1%A^OnKq@(`T5g;w%_3V0?269KZdpN zOIe;&nGEwd=ecbkWjXw+)_7_qK0a3Rm>s=}@wlPhXR)^k6V9Q& zxyuuMyk&w7O5WcH63wBZ#uK5wh5scm*l|ney~F^{L*%`CfDp!p1IBEJ01Y@59)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e3|Iggt(scHeKgf)TyGKZxfS=*G|BGeb|kVS?s9>;w)$z`^=rb{W^VU4w|SgNb;nuI zZ2^c1ZJUqRH=gQ5va=I)6PBAY+TppUGekYkIxNbf+?m?X#EisEb_xccHu&s@|yqH%^XvX(XKddWFumuIa2T@=geM)?>g6uMV& zN-esJ=8TR|6VB9ORTOGx>FONe62T?R6G{Y+aGB5~ED&0RLZ(^B49lm=w9;#IwnX?> zT<&p}WS!GM%B6m})7Vyi<$;zLR+iS!)Z|WIFfKZqdxCztmQhp@*Z-4sDCsf2yP{8| zsR39=LEfX*xcXXoeHhl`ewN56OZq+8PWy~^W$`|L8!Ji<>-f;4NuNc~!xkMDGZk%e pDebwYiuP#ixpPbB9d!9^QXuKw8rZ-9r!lA)^B5T3kXQGre*g*YwMqa0 diff --git a/cotisations/migrations/0010_auto_20160702_1840.py b/cotisations/migrations/0010_auto_20160702_1840.py new file mode 100644 index 00000000..fddacb5f --- /dev/null +++ b/cotisations/migrations/0010_auto_20160702_1840.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cotisations', '0009_remove_cotisation_user'), + ] + + operations = [ + migrations.AlterField( + model_name='article', + name='duration', + field=models.IntegerField(null=True, help_text='Durée exprimée en mois entiers', blank=True), + ), + ] diff --git a/cotisations/migrations/0011_auto_20160702_1911.py b/cotisations/migrations/0011_auto_20160702_1911.py new file mode 100644 index 00000000..aafb9ee9 --- /dev/null +++ b/cotisations/migrations/0011_auto_20160702_1911.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cotisations', '0010_auto_20160702_1840'), + ] + + operations = [ + migrations.AlterField( + model_name='cotisation', + name='date_start', + field=models.DateTimeField(), + ), + ] diff --git a/cotisations/migrations/__pycache__/0010_auto_20160702_1840.cpython-34.pyc b/cotisations/migrations/__pycache__/0010_auto_20160702_1840.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..04664eff4050f25e42c40b9b6aff3a8215cb6f08 GIT binary patch literal 739 zcmYk3OK%e~5P)Z&$!-(q36Qwtx|i-ILQo{s7J)z<=mC(Ba6Eq{b# ze+U18gRh*p@B=t8-n2^n7>(y)f8+T(8mB+f&BtFJz;C!ULefuY>lY+AEe|9><-yzo z&z*gcK2!nB1E@lnhv2>D0q_vMlQRSiU=_h7`6J*FywBo4bP;5p-8Z#ZG#r@}9ja35 z%(rPJma6PTQ)?Sn}ZZgBgvAupKI^ z%L?tFRGnBzv|)c7a%n{2K6*#B)gHL$;j`@*9JyTW3fuSZ1^)s6Tg4Cn literal 0 HcmV?d00001 diff --git a/cotisations/migrations/__pycache__/0011_auto_20160702_1911.cpython-34.pyc b/cotisations/migrations/__pycache__/0011_auto_20160702_1911.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a332f67edd8294e16fea12e5cf508e30a12ddf3 GIT binary patch literal 661 zcmZ9I&2H2%5XUF6lih@^)Ji~~A(tjuAwDEjidw;mURtTrUM#bAS6Mm9Vka!^wY&lk z(I-OkwI?n-04HX$t+uKYkH+Kie||H6Cp+oyy&o690)RVsv^e@lxZN=tg?|7BpblUb zKtSgZOb9iD8H1X`j6?8QF;EU&;-bbJ!ILqQcCwXm|Q+Q#{~#!KVol>V?r=p5m8WHb;2GR#6y2`rF_f#y_iLxA;E3~B^AhUExu z0DnelV^Cv6NqzF=p`L#>Z@bFf*WNFRvJkTGS}`rk*TtJ+D$2L73Irr5(a2i+bo;{d zO+?8~3)e~8`RKCJMxAEi^3of{Ri<$r=kD= literal 0 HcmV?d00001 diff --git a/cotisations/models.py b/cotisations/models.py index 195a70c8..e1a1a780 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -22,7 +22,7 @@ class Article(models.Model): name = models.CharField(max_length=255) prix = models.DecimalField(max_digits=5, decimal_places=2) cotisation = models.BooleanField() - duration = models.DurationField(blank=True, null=True) + duration = models.IntegerField(help_text="Durée exprimée en mois entiers", blank=True, null=True) def __str__(self): return self.name @@ -41,7 +41,7 @@ class Paiement(models.Model): class Cotisation(models.Model): facture = models.ForeignKey('Facture', on_delete=models.PROTECT) - date_start = models.DateTimeField(auto_now_add=True) + date_start = models.DateTimeField() date_end = models.DateTimeField() def __str__(self): @@ -59,7 +59,7 @@ class NewFactureForm(ModelForm): class Meta: model = Facture - exclude = ['user', 'prix', 'name'] + exclude = ['user', 'prix', 'name', 'valid'] class EditFactureForm(ModelForm): def __init__(self, *args, **kwargs): diff --git a/cotisations/templates/cotisations/facture.html b/cotisations/templates/cotisations/facture.html index dd3b917b..48147b96 100644 --- a/cotisations/templates/cotisations/facture.html +++ b/cotisations/templates/cotisations/facture.html @@ -1,4 +1,4 @@ -{% extends "users/sidebar.html" %} +{% extends "cotisations/sidebar.html" %} {% load bootstrap3 %} {% block title %}Création et modification de factures{% endblock %} diff --git a/cotisations/views.py b/cotisations/views.py index 535f91cd..4a0f15c6 100644 --- a/cotisations/views.py +++ b/cotisations/views.py @@ -6,15 +6,34 @@ from django.shortcuts import render_to_response, get_object_or_404 from django.core.context_processors import csrf from django.template import Context, RequestContext, loader from django.contrib import messages +from django.db.models import Max -from cotisations.models import NewFactureForm, EditFactureForm, Facture, Article +from cotisations.models import NewFactureForm, EditFactureForm, Facture, Article, Cotisation from users.models import User +from dateutil.relativedelta import relativedelta +import datetime + def form(ctx, template, request): c = ctx c.update(csrf(request)) return render_to_response(template, c, context_instance=RequestContext(request)) +def end_adhesion(user): + """ Renvoie la date de fin d'adhésion d'un user, False sinon """ + date_max = Cotisation.objects.all().filter(facture=Facture.objects.all().filter(user=user)).aggregate(Max('date_end'))['date_end__max'] + return date_max + +def create_cotis(facture, user, article): + """ Update et crée l'objet cotisation associé à une facture, prend en argument l'user, la facture pour la quantitéi, et l'article pour la durée""" + cotisation=Cotisation(facture=facture) + date_max = end_adhesion(user) or datetime.datetime.now() + if date_max: + cotisation.date_start=date_max + cotisation.date_end = cotisation.date_start + relativedelta(months=article[0].duration*facture.number) + cotisation.save() + return + def new_facture(request, userid): try: user = User.objects.get(pk=userid) @@ -29,7 +48,11 @@ def new_facture(request, userid): new_facture.prix = article[0].prix new_facture.name = article[0].name new_facture.save() - messages.success(request, "La facture a été crée") + if article[0].cotisation == True: + create_cotis(new_facture, user, article) + messages.success(request, "La cotisation a été prolongée pour l'adhérent %s " % user.name ) + else: + messages.success(request, "La facture a été crée") return redirect("/cotisations/") return form({'factureform': facture_form}, 'cotisations/facture.html', request) diff --git a/users/__pycache__/__init__.cpython-34.pyc b/users/__pycache__/__init__.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..864eb52b89e8e82335f9ee51df5f82a482f040c6 GIT binary patch literal 114 zcmaFI!^_p0QxeVq1dl-k3@`#24nSPY0whux7=kq!{Z=v*frJsnFM0j4#3KFj@^by6 pRHJuajsB$>IHHjLP)+?Cc8=<*>TuS8r9eGGkijS zWv@s`y>LdHm{~g|ZMhUX9?k3<@4k66&d+!dUHv-$GK!`|hgKgLJ@KqK(SpaiHG zqzssFK)6skP`Qx0P4FU4(g8*%wM!nz@Xitv>EBuMK}L2-#4t?;*H|kg z%$+wFFw zyFAe#l9RoixB&eh4eSgMZI?6cd{_D?lQhm@IN*E0d1vt*K1=AKU9;X@Q9(Xk#$)4E9?hiN0V?z>G>I+E--tr;Iv>4S^Tp*SOo%8*nr z!^+{wPCo6f|0BPqdn}ukH~j(KwBL8ZwA4|(zc#fQATxL)o_*bAjqh|RnO4P zRiUF!JavwqS@j_BRFIX1>`X%r4LKF$r6E7lkViv71xwPfG}BN(Ls13G(y*+;v`nxB zYDonvLR}eCi=eKmU`?oNW9l-fWfj~K>a8)g1nO%lxGmJ%W9ka1>nhj~>c*J53hJf` zwuHJhrmm^rbycst@tj~*9OHHSK^Vm-(`6aWk~&sC}cDABWsvT6W5lmXk4 z0;DXjsB_0@tj>)ke_*%3zkGoLB+&;Df-Uy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jV%*j@?I;Va^n57vh}-Gn{cgRg8W}4qOgG9M&(GAc-%5S-#GY^#WiM zmqq=#6tMQJ*D6i8Sg0x(b#s(H<`Qm<(ml>i4kMIUe^rzUHfDKMm{z82EKUrYF2RX` z%{46XfUCSQP9I=&og79uv3>z3&|b-*o4ka=0vvUUUwV`zP~Z`h+&EB>Sftii`XuQf z0DvM7Y_Q&N_jJFL*qGh5ZhRLr-OP>u2_s{=W_#cd%ab)-?!^gc73uokrZnX!u6uGJ zxI{S^OJ74d{!9Vpl;h=3eM0ufDW9^dNogTXzAQ>rB#HPI9EH7;hAtn`PO|D;JhnZ( zcoX5vPa46}L4 zuDtrlYlU3(Otyb`61I}qq!AjL_1)vJ_32^%X&tXbtzn|yH6?6v#b!J%AK8^uxmi0^(nO%Xjy(ju=b^4f<2(N6JSa(QBuXalG!OZ3J1 q17^F-IN@b@ncRE!)#rWsjF^EhVgWjLF|waZ~}w`5>gPUBJ7q_X;RrKfowSqhu|XF zvSPylSTP<5WkKSMJ>PG8^4lLyr+u}VUt0#i8~k}}9G~H*UNLZN3}S#O1D^ro25=K% z1EwbUCNRN(*FcyssR6G8Z@{xbut^XJHmiayf(?T03fcsl1f2?Y2wDV}D!5FrMbNF_ z3c)tPRSm~Y@NM90aM@dbM+?wnr8$@JJNq8jA0m;f!VVIV59dlquUpoVa4HH5Nnev< zHxN9^hEXy~y}i?mV+|vIa&yo>y4~+}ijG$ZAqlAmc^PW?>d=e((ba0m@qXAl05-%4@ zkTvXlZI2B5^!wyaHc*jGE$edMCH&TJHEHP$Y}{)WW|@$QdI9O^H9CB5dk>-X@;vvX iI7~f#Ov=-R2eYTrI-aI{9*Yxw@XE#D8m_s)7Vj7NiK5T| literal 0 HcmV?d00001 diff --git a/users/__pycache__/views.cpython-34.pyc b/users/__pycache__/views.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4ffd82d46cfbe21647ccb2df920754b65e4cc50 GIT binary patch literal 3792 zcmds4-EJGl6+XjVl1qw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odYT5(2gIw58Pm=L50uND>_BmkA z|7yO~nELzJss~Jdz=T6h|Bwj>g-M0j=W0zs+oWSidkEC$5W7 z+(b(I?}Z}gL7(h>5dO<0{x%`G^|%Cpt5fe$K>BOC%!>^lluIrYQ4g93#b}-l5uvl4 zI0NS+!iURbSKgdmbrIjai1;-Z@wmt<8N^=wnnC;EKl6^bIpKOKe==uoPC4xED$~E& zFG_3rQuSFx^%3|-2z)iRSNn_evAc?QU2aO|4mVhLso^c&w1IbDdQ;U&bCryh9HLSt zE+4pLT}6{qIW*=Z(OcNyhhv);m&s!gy1a4ed2x#~$dGHx>-i&c5TIrF1c#YE$YT27 zlCXnBa!qXGJ1Y*{3Z(zDa*EEDKGS7p`^l)BqKsZ-@T)C@+PRJ`m%w_QTqL_p>mu2u z+gZV^Yi_q*2db4wIdm((#&K_!%v+17@R=N|w^=j;K~>~B_f1X4{aKTNYTBEXzR){= zokk7k{Il}eB(014)!z5yy9RNT_`8Z#nyw9 zly5oRKQEUpn1dpm<$*4HzuC{wzCUsORMmDfLv&;o!NO(R#by;D5D+L2pK5M?W*wCN zIj_G~ckAx7udrg+&?MG{{uI9lgAc2&9HGvXd*-CnHl14IPV*&$g>@YyzA=+ZORe_i zJ@Q1C+{KmJxZb#0oe9l5V%_BZ+$`%BNVRft2r^Ul(3vIfIPLb(uBhC2?YL-odotdx zo77$ATnXa~5jTjMI||M9Npnij908hb=YUuM q%t7bd&R^hC(_HYb>wjPE*rTmJ@MM;QbF literal 0 HcmV?d00001 diff --git a/users/migrations/0003_listrights_rights.py b/users/migrations/0003_listrights_rights.py new file mode 100644 index 00000000..01257a4f --- /dev/null +++ b/users/migrations/0003_listrights_rights.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0002_auto_20160630_2301'), + ] + + operations = [ + migrations.CreateModel( + name='ListRights', + fields=[ + ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), + ('listright', models.CharField(max_length=255)), + ], + ), + migrations.CreateModel( + name='Rights', + fields=[ + ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), + ('right', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='users.ListRights')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='users.User')), + ], + ), + ] diff --git a/users/migrations/0004_auto_20160701_2312.py b/users/migrations/0004_auto_20160701_2312.py new file mode 100644 index 00000000..e42b036b --- /dev/null +++ b/users/migrations/0004_auto_20160701_2312.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0003_listrights_rights'), + ] + + operations = [ + migrations.RenameModel( + old_name='ListRights', + new_name='ListRight', + ), + migrations.RenameModel( + old_name='Rights', + new_name='Right', + ), + ] diff --git a/users/migrations/0005_auto_20160702_0006.py b/users/migrations/0005_auto_20160702_0006.py new file mode 100644 index 00000000..1cb0721c --- /dev/null +++ b/users/migrations/0005_auto_20160702_0006.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0004_auto_20160701_2312'), + ] + + operations = [ + migrations.AlterUniqueTogether( + name='right', + unique_together=set([('user', 'right')]), + ), + ] diff --git a/users/migrations/__pycache__/0001_initial.cpython-34.pyc b/users/migrations/__pycache__/0001_initial.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2341cf4297e4846b28b176b7cd825c8c66a723d4 GIT binary patch literal 1367 zcmbtUOLNmO5MDpx#HmYDprwTwrj$nshon4?4AV}MLWgO~v;k&v@wkzaIQS7HyCJ!j zD|h|^e@RzPx$pxx04uqn1#-iVl=Y|e?zf+`{^raV)4lZV=N!OSxNw2gp2v8iHLN4gEaerT+~` z7G`82rCH#j0+A>3xqQZlT$$y0br!fZ3tXOp*MO|3$g4oE1Gx+29*_;_8koqCYOE6@ttpD}02^C%^A})`F}|99DE%oN4HE{v-Az^hLQa*X&3JY zn({9fq!gVrNf{Q;)E?Ox-3mEY?%P56qS3Cw`G1#84DpcY*C_67@quZjICjVBppgvTYz zLtgm0aFaO7!!pj&Lf8p{yqHM(^|Ob;DURX`P7I_7)G*e8wje@H1~60ZS1Z8%s139M z%!YXbXcMRd)CGDE)}XJ!xJ&k~$;jLRx(jp<=wqM_WvE#vUP; zRmf!zn$*3H`LRN6NetBvQ=C1F)&q#JaOgX5!sbdQ40;o@^{VUY%o;sH*c z;h2tQ<9ndj{|Z0%ZRu!Ql~s-&a@Aai&cigy4(UhbLMd158(nqu91Dx)i@F~#<+p`& Ixv#g3zh3R+s{jB1 literal 0 HcmV?d00001 diff --git a/users/migrations/__pycache__/0003_listrights_rights.cpython-34.pyc b/users/migrations/__pycache__/0003_listrights_rights.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94e2dc8a11b05729bb6dead1fddbdf6a1605d137 GIT binary patch literal 1088 zcma)5&rj4q6n>p{%eGr!RRqzK7s+0B%aRZe#$Zs4QNSR^WG|DlGn6jkZZtOTG0Oj z-Zp@E+#TRPj9M^48Uc)Efh_>LtC97&i~mepx=f30?I54Q9I$&>#rw+JzABY!RFVs+ zmclUX)2J#7+7DOP!}Yb0_SeEy<>XPumH#G@iJdewx^Iv#1%Dp_P zQGfS}oZ@Zrk}Fac)3#yUy}`)Qk*QzD-=n|NA=6se^l!pC^QuV=9ZHo?DK<=%a`XdA zKUPtyiRw4T$2?~|A0}K1Y<5tsO(SYscbIT=#CwKy+tO80-sVvxYS-T?1W)4pHJ>P# zjiNj*6k!LdX|!OQs+qTYyZbLT_my9av5QUXegW|aF^#!++&hUx@AUMvCwRZ;8G*g) zHt*r3t>G_lSx8Auy<~Sh5e>v>;*tw!0^4&u%Oxw;1G|2%SSF*>)Y1>DvJxm(5X@Cx vO|{DojNDq`@}FS0{k(DDwsknBDVdVUTS5=%zH-IY$A8T4Frq{Krt#cB*{|xsw~Cp#TcVy$#9L6W5O?nBU3y)pbhTQgO3u5~t(k5GPjTTlycqh9&$HRv>^Ph8 z`O$2CxcsRCY%)R9d+4TKfjN5FN)(Hi@>PQW5-yT$*esMMy0w;=qYs09D$Hm9B?0RX(kkICvCp$CJCeoFcQVfw$JwiFA@diD+={kn(E7S6uX_80gx?G(`>w?P z3bhsP_j%%NCz|bJG=vzT+leR%Z78K2A!{rLFIyv&mLc)fzkTO2mI`6;D2sdgYUih-B`0Q*!O A3IG5A literal 0 HcmV?d00001 diff --git a/users/models.py b/users/models.py index 4867a3df..333ac569 100644 --- a/users/models.py +++ b/users/models.py @@ -101,3 +101,4 @@ class DelRightForm(ModelForm): class Meta: model = Right exclude = ['user', 'right'] + diff --git a/users/templates/users/index.html b/users/templates/users/index.html index a11c47bc..a2f9ce5d 100644 --- a/users/templates/users/index.html +++ b/users/templates/users/index.html @@ -10,6 +10,7 @@ Prénom Nom Pseudo + Modifier {% for user in users_list %} @@ -17,6 +18,7 @@ {{ user.name }} {{ user.surname }} {{ user.pseudo }} + Editer {% endfor %}