Browse Source

support user not found for a name.

master
philippe lhardy 3 years ago
parent
commit
f87767d25e
1 changed files with 28 additions and 12 deletions
  1. +28
    -12
      jm2l/views.py

+ 28
- 12
jm2l/views.py View File

@@ -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…
Cancel
Save