0003-data_transfer-fix-indentation-whitespaces-29545.patch
src/authentic2/data_transfer.py | ||
---|---|---|
110 | 110 |
ou = None if not has_ou else search_ou(ou_d) |
111 | 111 |
if has_ou and not ou: |
112 | 112 |
raise DataImportError( |
113 |
"Can't import role because missing Organizational Unit : " |
|
114 |
"%s" % ou_d) |
|
113 |
"Can't import role because missing Organizational Unit: %s" % ou_d) |
|
115 | 114 | |
116 | 115 |
kwargs = self._role_d.copy() |
117 | 116 |
del kwargs['ou'] |
... | ... | |
163 | 162 |
for parent_d in self._parents: |
164 | 163 |
parent = search_role(parent_d) |
165 | 164 |
if not parent: |
166 |
raise DataImportError("Could not find role : %s" % parent_d)
|
|
165 |
raise DataImportError("Could not find role: %s" % parent_d) |
|
167 | 166 |
created.append(Parenting.objects.create( |
168 | 167 |
child=self._obj, direct=True, parent=parent)) |
169 | 168 | |
... | ... | |
234 | 233 | |
235 | 234 |
def import_ou(ou_d): |
236 | 235 |
OU = get_ou_model() |
237 |
# ou = search_ou([ou_d['slug']]) |
|
238 | 236 |
ou = search_ou(ou_d) |
239 | 237 |
if ou is None: |
240 | 238 |
ou = OU.objects.create(**ou_d) |
... | ... | |
276 | 274 | |
277 | 275 |
if import_context.ou_delete_orphans: |
278 | 276 |
raise DataImportError( |
279 |
"Unsupported context value for ou_delete_orphans : %s" % (
|
|
277 |
"Unsupported context value for ou_delete_orphans: %s" % ( |
|
280 | 278 |
import_context.ou_delete_orphans)) |
281 | 279 | |
282 | 280 |
if import_context.role_delete_orphans: |
283 |
# FIXME : delete each role that is in DB but not in the export
|
|
281 |
# FIXME: delete each role that is in DB but not in the export |
|
284 | 282 |
raise DataImportError( |
285 |
"Unsupported context value for role_delete_orphans : %s" % (
|
|
283 |
"Unsupported context value for role_delete_orphans: %s" % ( |
|
286 | 284 |
import_context.role_delete_orphans)) |
287 | 285 | |
288 | 286 |
return result |
289 |
- |