瀏覽代碼

support user not found for a name.

master
philippe lhardy 7 年之前
父節點
當前提交
f87767d25e
共有 1 個檔案被更改,包括 28 行新增12 行删除
  1. +28
    -12
      jm2l/views.py

+ 28
- 12
jm2l/views.py 查看文件

@@ -507,12 +507,20 @@ def expenses(request):
if dic_out[tab_path[4]].get('RIB') is None:
dic_out[tab_path[4]]['RIB'] = {'files':[], 'thumb':[]}
u = User.by_slug(tab_path[4])
dic_out[tab_path[4]]['User'] = {
'uid':u.uid,
'nom':u.nom,
'prenom':u.prenom,
'slug':u.slug
}
if u is None:
dic_out[tab_path[4]]['User'] = {
'uid':'# NOT FOUND',
'nom':name,
'prenom':'# NOT FOUND',
'slug':'# NOT FOUND'
}
else:
dic_out[tab_path[4]]['User'] = {
'uid':u.uid,
'nom':u.nom,
'prenom':u.prenom,
'slug':u.slug
}
dic_out[tab_path[4]]['RIB']['files'].append( name )
dic_out[tab_path[4]]['RIB']['thumb'].append( name + ".jpg" )

@@ -525,12 +533,20 @@ def expenses(request):
if dic_out[tab_path[4]].get('Justif') is None:
dic_out[tab_path[4]]['Justif'] = {'files':[], 'thumb':[]}
u = User.by_slug(tab_path[4])
dic_out[tab_path[4]]['User'] = {
'uid':u.uid,
'nom':u.nom,
'prenom':u.prenom,
'slug':u.slug
}
if u is None:
dic_out[tab_path[4]]['User'] = {
'uid':'# NOT FOUND',
'nom':name,
'prenom':'# NOT FOUND',
'slug':'# NOT FOUND'
}
else:
dic_out[tab_path[4]]['User'] = {
'uid':u.uid,
'nom':u.nom,
'prenom':u.prenom,
'slug':u.slug
}
dic_out[tab_path[4]]['Justif']['files'].append( name )
dic_out[tab_path[4]]['Justif']['thumb'].append( name + ".jpg" )



Loading…
取消
儲存