116 |
116 |
report = job.action.report
|
117 |
117 |
if not report:
|
118 |
118 |
raise Http404('no report')
|
119 |
|
text_report = report
|
120 |
|
if six.PY3:
|
121 |
|
text_report = io.TextIOWrapper(text_report, encoding='utf-8')
|
122 |
|
reader = csv.reader(text_report)
|
123 |
|
next(reader)
|
124 |
|
actions = [row for row in reader if row[6] != 'KEEP']
|
125 |
|
context = dict(
|
126 |
|
model_admin.admin_site.each_context(request),
|
127 |
|
title=job.created,
|
128 |
|
job=job,
|
129 |
|
csv=actions,
|
130 |
|
csv_url=job.action.download_report_url,
|
131 |
|
csv_filesize=report.size,
|
132 |
|
)
|
133 |
|
return TemplateResponse(request, "admin/zoo_data/entity/synchronize_federations_report.html", context)
|
|
119 |
with report:
|
|
120 |
text_report = report
|
|
121 |
if six.PY3:
|
|
122 |
text_report = io.TextIOWrapper(text_report, encoding='utf-8')
|
|
123 |
reader = csv.reader(text_report)
|
|
124 |
next(reader)
|
|
125 |
actions = [row for row in reader if row[6] != 'KEEP']
|
|
126 |
context = dict(
|
|
127 |
model_admin.admin_site.each_context(request),
|
|
128 |
title=job.created,
|
|
129 |
job=job,
|
|
130 |
csv=actions,
|
|
131 |
csv_url=job.action.download_report_url,
|
|
132 |
csv_filesize=report.size,
|
|
133 |
)
|
|
134 |
return TemplateResponse(request, "admin/zoo_data/entity/synchronize_federations_report.html", context)
|
134 |
135 |
|
135 |
136 |
|
136 |
137 |
@permission_required('zoo_data.action1_entity')
|
... | ... | |
148 |
149 |
jobs = SynchronizeFederationsAction.get_jobs()
|
149 |
150 |
job = get_object_or_404(jobs, id=job_id)
|
150 |
151 |
report = job.action.apply_report
|
151 |
|
if not report:
|
152 |
|
raise Http404('no report')
|
153 |
|
text_report = report
|
154 |
|
if six.PY3:
|
155 |
|
text_report = io.TextIOWrapper(text_report, encoding='utf-8')
|
156 |
|
reader = csv.reader(text_report)
|
157 |
|
next(reader)
|
158 |
|
actions = [row for row in reader if row[6] != 'KEEP']
|
159 |
|
context = dict(
|
160 |
|
model_admin.admin_site.each_context(request),
|
161 |
|
title=u'Application - %s' % job.created,
|
162 |
|
job=job,
|
163 |
|
csv=actions,
|
164 |
|
csv_url=job.action.download_apply_report_url,
|
165 |
|
csv_filesize=report.size,
|
166 |
|
)
|
167 |
|
return TemplateResponse(request, "admin/zoo_data/entity/synchronize_federations_report.html", context)
|
|
152 |
with report:
|
|
153 |
if not report:
|
|
154 |
raise Http404('no report')
|
|
155 |
text_report = report
|
|
156 |
if six.PY3:
|
|
157 |
text_report = io.TextIOWrapper(text_report, encoding='utf-8')
|
|
158 |
reader = csv.reader(text_report)
|
|
159 |
next(reader)
|
|
160 |
actions = [row for row in reader if row[6] != 'KEEP']
|
|
161 |
context = dict(
|
|
162 |
model_admin.admin_site.each_context(request),
|
|
163 |
title=u'Application - %s' % job.created,
|
|
164 |
job=job,
|
|
165 |
csv=actions,
|
|
166 |
csv_url=job.action.download_apply_report_url,
|
|
167 |
csv_filesize=report.size,
|
|
168 |
)
|
|
169 |
return TemplateResponse(request, "admin/zoo_data/entity/synchronize_federations_report.html", context)
|
168 |
170 |
|
169 |
171 |
|
170 |
172 |
@permission_required('zoo_data.action1_entity')
|
171 |
|
-
|