Commit 6d61ae9e authored by Georges Gressot's avatar Georges Gressot 💬
Browse files

au tour des bases ...?

parent b1c83f21
...@@ -1034,8 +1034,6 @@ def addinstr(request, bdd, sid, lid): ...@@ -1034,8 +1034,6 @@ def addinstr(request, bdd, sid, lid):
i.line +=1 i.line +=1
i.time =Now() i.time =Now()
i.save(using=bdd) i.save(using=bdd)
return addinstr(request, bdd, sid, lid)
else: else:
info = _("Vous ne pouvez pas valider deux fois la même ligne d'instruction.") info = _("Vous ne pouvez pas valider deux fois la même ligne d'instruction.")
...@@ -1143,9 +1141,9 @@ def selinstr(request, bdd, sid, lid): ...@@ -1143,9 +1141,9 @@ def selinstr(request, bdd, sid, lid):
if f.is_valid(): if f.is_valid():
linetomodify = f.cleaned_data['row'] linetomodify = f.cleaned_data['row']
return modinstr(request, bdd, sid, lid, linetomodify) # return modinstr(request, bdd, sid, lid, linetomodify)
# url =bdd + "/mod/" + str(sid) + "/" + str(lid) + "/" + str(linetomodify) url ="/" + bdd + "/mod/" + str(sid) + "/" + str(lid) + "/" + str(linetomodify)
# return HttpResponseRedirect(url) return HttpResponseRedirect(url)
instrlist = Instruction.objects.using(bdd).filter(sid = sid).order_by('line') instrlist = Instruction.objects.using(bdd).filter(sid = sid).order_by('line')
...@@ -1303,14 +1301,14 @@ def modinstr(request, bdd, sid, lid, linetomodify): ...@@ -1303,14 +1301,14 @@ def modinstr(request, bdd, sid, lid, linetomodify):
except: except:
pklastone =0 pklastone =0
if info =="": if info =="":
return addinstr(request, bdd, sid, lid) # return addinstr(request, bdd, sid, lid)
# url =bdd + "/add/" + str(sid) + "/" + str(lid) url ="/" + bdd + "/add/" + str(sid) + "/" + str(lid)
# return HttpResponseRedirect(url) # Renumbering shall be done there. return HttpResponseRedirect(url) # Renumbering shall be done there.
else: else:
#Instruction form instanciation and validation : #Instruction form instanciation and validation :
f = InstructionForm(instance =i, initial = { f = InstructionForm(instance =i, initial = {
'line' : Instruction.objects.using(bdd).get(sid =sid, line =linetomodify).line - 1, 'line' : Instruction.objects.using(bdd).get(sid =sid, line =linetomodify).line - 1,
'oname' : Instruction.objects.using(bdd).get(sid =sid, line =linetomodify).oname, # 'oname' : Instruction.objects.using(bdd).get(sid =sid, line =linetomodify).oname,
'descr' : Instruction.objects.using(bdd).get(sid =sid, line =linetomodify).descr, 'descr' : Instruction.objects.using(bdd).get(sid =sid, line =linetomodify).descr,
'exc' : Instruction.objects.using(bdd).get(sid =sid, line =linetomodify).exc, 'exc' : Instruction.objects.using(bdd).get(sid =sid, line =linetomodify).exc,
'degr' : Instruction.objects.using(bdd).get(sid =sid, line =linetomodify).degr, 'degr' : Instruction.objects.using(bdd).get(sid =sid, line =linetomodify).degr,
......
Supports Markdown
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