f8a72a0a60658d462753fe39a2119932358ccca5,app/server/views.py,DataUpload,post,#DataUpload#Any#,58

Before Change


                else:
                    reader = csv.reader(form_data)
                    Document.objects.bulk_create([
                        Document(text=line[0].strip(), project=project)
                        for line in reader
                    ])

            elif import_format == "json":

After Change


                if not batch:
                    break

                Document.objects.bulk_create(batch, batch_size=batch_size)
                return HttpResponseRedirect(reverse("dataset", args=[project.id]))
        except DataUpload.ImportFileError as e:
            messages.add_message(request, messages.ERROR, e.message)
            return HttpResponseRedirect(reverse("upload", args=[project.id]))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: chakki-works/doccano
Commit Name: f8a72a0a60658d462753fe39a2119932358ccca5
Time: 2018-12-26
Author: sergiy.n@attendify.com
File Name: app/server/views.py
Class Name: DataUpload
Method Name: post


Project Name: chakki-works/doccano
Commit Name: 95f5c79a1d97630f9afbcbe2d3906ed4e0f24777
Time: 2018-08-14
Author: light.tree.1.13@gmail.com
File Name: app/server/views.py
Class Name: DataUpload
Method Name: post


Project Name: okfn-brasil/serenata-de-amor
Commit Name: 6a75ec12d58d45bc939cc249630fa476c8c95231
Time: 2016-09-08
Author: cuducos@gmail.com
File Name: jarbas/core/management/commands/loaddatasets.py
Class Name: Command
Method Name: handle