Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 750d8e98 authored by Marc Duez's avatar Marc Duez
Browse files

server : birth date and sample date are no longer required

parent 0a93c832
......@@ -43,7 +43,7 @@ def logger():
log.log(lvl, res)
def init_db(force=False):
if (db(db.auth_user.id > 0).count() == 0) or (force) :
if (force) or (db(db.auth_user.id > 0).count() == 0) :
for table in db :
table.truncate()
......
......@@ -36,11 +36,11 @@ def add_form():
import shutil, os.path, datetime
error = ""
if request.vars['sampling_date'] != None :
if request.vars['sampling_date'] != '' :
try:
datetime.datetime.strptime(""+request.vars['sampling_date'], '%Y-%m-%d')
except ValueError:
error += "date missing or wrong format, "
error += "date (wrong format), "
if request.vars['filename'] == None :
error += " missing filename"
......@@ -98,6 +98,11 @@ def edit_form():
error += "missing id"
if request.vars['filename'] == None :
error += " missing filename"
if request.vars['sampling_date'] != '' :
try:
datetime.datetime.strptime(""+request.vars['sampling_date'], '%Y-%m-%d')
except ValueError:
error += "date (wrong format), "
if error=="" :
mes = "file " + str(request.vars['id']) + " : "
......
......@@ -439,10 +439,11 @@ def add_form():
error += "first name needed, "
if request.vars["last_name"] == "" :
error += "last name needed, "
try:
datetime.datetime.strptime(""+request.vars['birth'], '%Y-%m-%d')
except ValueError:
error += "date missing or wrong format"
if request.vars["birth"] != "" :
try:
datetime.datetime.strptime(""+request.vars['birth'], '%Y-%m-%d')
except ValueError:
error += "date (wrong format)"
if error=="" :
id = db.patient.insert(first_name=request.vars["first_name"],
......@@ -504,10 +505,11 @@ def edit_form():
error += "first name needed, "
if request.vars["last_name"] == "" :
error += "last name needed, "
try:
datetime.datetime.strptime(""+request.vars['birth'], '%Y-%m-%d')
except ValueError:
error += "date missing or wrong format"
if request.vars["birth"] != "" :
try:
datetime.datetime.strptime(""+request.vars['birth'], '%Y-%m-%d')
except ValueError:
error += "date (wrong format)"
if request.vars["id"] == "" :
error += "patient id needed, "
......
......@@ -27,7 +27,7 @@
<tr>
<td><label for="sampling_date" id="sampling_date__label">sampling date: </label></td>
<td><input class="date" id="sampling_date" name="sampling_date" type="text" value="">
<span>* (format: yyyy-mm-dd)</span></td>
<span>(format: yyyy-mm-dd)</span></td>
<td></td>
</tr>
<tr>
......
......@@ -24,7 +24,7 @@ info = db.sequence_file[request.vars["id"]]
<tbody>
<tr>
<td> <label for="sampling_date" id="sampling_date__label">sampling date: </label> </td>
<td> <input class="date" id="sampling_date" name="sampling_date" type="text" value="{{=info.sampling_date}}"> <span>* (format: yyyy-mm-dd)</span> </td>
<td> <input class="date" id="sampling_date" name="sampling_date" type="text" value="{{=info.sampling_date}}"> <span>(format: yyyy-mm-dd)</span> </td>
<td> </td>
</tr>
<tr>
......
......@@ -20,7 +20,7 @@
</tr>
<tr>
<td><label for="patient_birth" id="patient_birth__label">Birth: </label></td>
<td><input class="date" id="patient_birth" name="birth" type="text" value=""><span>* (format: yyyy-mm-dd)</span></td>
<td><input class="date" id="patient_birth" name="birth" type="text" value=""><span>(format: yyyy-mm-dd)</span></td>
<td></td>
</tr>
<tr>
......
......@@ -25,7 +25,7 @@ info = db.patient[request.vars["id"]]
</tr>
<tr>
<td> <label for="patient_birth" id="patient_birth__label">Birth: </label></td>
<td> <input class="date" id="patient_birth" name="birth" type="text" value="{{=info.birth}}"><span>* (yyyy-mm-dd)</span></td>
<td> <input class="date" id="patient_birth" name="birth" type="text" value="{{=info.birth}}"><span>(yyyy-mm-dd)</span></td>
<td> </td>
</tr>
<tr>
......
Markdown is supported
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