Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Ticket = rt.modules.tickets.Ticket
User = rt.modules.users.User
TicketStates = rt.modules.tickets.TicketStates
states = set()
for n, row in enumerate(codecs.open(fn, encoding="utf-8").readlines()):
if n == 0:
continue # headers
if not row:
continue
cells = row.split('\t')
if len(cells) != len(COLUMNS):
msg = "Oops, line {0} has {1} cells".format(n, len(cells))
raise Exception(msg)
d = AttrDict()
for i, k in enumerate(COLUMNS):
d.define(k, cells[i])
kw = dict()
kw.update(id=d.id)
kw.update(summary=d.summary)
if d.reporter:
kw.update(reporter=makeuser(d.reporter))
else:
kw.update(reporter=makeuser('luc'))
if d.owner:
kw.update(
assigned_to=makeuser(d.owner))
if d.component:
prj = Project.objects.get_or_create(ref=d.component)[0]
else:
prj = Project.objects.get_or_create(ref='etc')[0]
Ticket = rt.modules.tickets.Ticket
User = rt.modules.users.User
TicketStates = rt.modules.tickets.TicketStates
states = set()
for n, row in enumerate(codecs.open(fn, encoding="utf-8").readlines()):
if n == 0:
continue # headers
if not row:
continue
cells = row.split('\t')
if len(cells) != len(COLUMNS):
msg = "Oops, line {0} has {1} cells".format(n, len(cells))
raise Exception(msg)
d = AttrDict()
for i, k in enumerate(COLUMNS):
d.define(k, cells[i])
kw = dict()
kw.update(id=d.id)
kw.update(summary=d.summary)
if d.reporter:
kw.update(reporter=makeuser(d.reporter))
else:
kw.update(reporter=makeuser('luc'))
if d.owner:
kw.update(
assigned_to=makeuser(d.owner))
if d.component:
prj = Project.objects.get_or_create(ref=d.component)[0]
else:
prj = Project.objects.get_or_create(ref='etc')[0]
Ticket = rt.modules.tickets.Ticket
User = rt.modules.users.User
TicketStates = rt.modules.tickets.TicketStates
states = set()
for n, row in enumerate(codecs.open(fn, encoding="utf-8").readlines()):
if n == 0:
continue # headers
if not row:
continue
cells = row.split('\t')
if len(cells) != len(COLUMNS):
msg = "Oops, line {0} has {1} cells".format(n, len(cells))
raise Exception(msg)
d = AttrDict()
for i, k in enumerate(COLUMNS):
d.define(k, cells[i])
kw = dict()
kw.update(id=d.id)
kw.update(summary=d.summary)
if d.reporter:
kw.update(user=User.objects.get_or_create(username=d.reporter)[0])
else:
kw.update(user=User.objects.get(username='robin'))
if d.owner:
kw.update(
assigned_to=User.objects.get_or_create(username=d.owner)[0])
if d.component:
prj = Project.objects.get_or_create(ref=d.component)[0]
else:
prj = Project.objects.get_or_create(ref=d.component)[0]