Revision 73c02f75
b/snf-astakos-app/astakos/im/management/commands/resource-import.py | ||
---|---|---|
111 | 111 |
for resource in resources: |
112 | 112 |
if not isinstance(resource, dict): |
113 | 113 |
raise CommandError("Malformed resource dict.") |
114 |
exists = add_resource(s, resource) |
|
115 |
name = resource['name']
|
|
114 |
r, exists = add_resource(s, resource)
|
|
115 |
name = r.name
|
|
116 | 116 |
if exists: |
117 | 117 |
m = "Resource '%s' updated in database.\n" % (name) |
118 | 118 |
else: |
b/snf-astakos-app/astakos/im/resources.py | ||
---|---|---|
70 | 70 |
logger.info("Updated resource %s." % (name)) |
71 | 71 |
else: |
72 | 72 |
logger.info("Added resource %s." % (name)) |
73 |
return exists |
|
73 |
return r, exists
|
|
74 | 74 |
|
75 | 75 |
|
76 | 76 |
def update_resource(resource, uplimit): |
Also available in: Unified diff