|
@@ -30,8 +30,8 @@ def admin_update(request):
|
30
|
30
|
obj = (target_leo.get(('lodel_id = %s' % (uid))))[0]
|
31
|
31
|
inserted = obj.update(fields)
|
32
|
32
|
|
33
|
|
- if new_uid==1:
|
34
|
|
- msg = 'Successfull creation';
|
|
33
|
+ if inserted==1:
|
|
34
|
+ msg = 'Successfully updated';
|
35
|
35
|
else:
|
36
|
36
|
msg = 'Oops something wrong happened...object not saved'
|
37
|
37
|
return get_response('admin/admin_edit.html', target=target_leo, lodel_id = uid, msg = msg)
|
|
@@ -51,10 +51,19 @@ def admin_update(request):
|
51
|
51
|
obj = dyncode.Object.get(['lodel_id = %d' % lodel_id])
|
52
|
52
|
if len(obj) == 0:
|
53
|
53
|
raise HttpException(404)
|
|
54
|
+ if 'classname' in request.GET:
|
|
55
|
+ classname = request.GET['classname']
|
|
56
|
+ if len(classname) > 1:
|
|
57
|
+ raise HttpException(400)
|
|
58
|
+ classname = classname[0]
|
|
59
|
+ try:
|
|
60
|
+ target_leo = dyncode.Object.name2class(classname)
|
|
61
|
+ except LeApiError:
|
|
62
|
+ classname = None
|
54
|
63
|
template_vars = {
|
55
|
64
|
'params': request.GET
|
56
|
65
|
}
|
57
|
|
- return get_response('admin/admin_edit.html', tpl_vars=template_vars)
|
|
66
|
+ return get_response('admin/admin_edit.html', target=target_leo, lodel_id =lodel_id, tpl_vars=template_vars)
|
58
|
67
|
|
59
|
68
|
def admin_create(request):
|
60
|
69
|
classname = None
|