Skip to content

Commit

Permalink
fix resource export bug
Browse files Browse the repository at this point in the history
  • Loading branch information
guohongze committed Apr 18, 2019
1 parent 21a1801 commit 0cdaef9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions branches/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@ def resource_export(request):
if r.branch:
br = Branch.objects.get(name=r.branch)
else:
br = ""
writer.writerow([str2gb(br.region.name), str2gb(r.branch.name), r.sn, str2gb(r.name), str2gb(r.spec),
str2gb(r.budget), str2gb(r.paid), str2gb(r.contract), str2gb(r.contract_start), str2gb(r.contract_end),
str2gb(r.supplier), str2gb(r.service_phone), str2gb(r.owner), str2gb(r.owner.phone),
br = None

writer.writerow([str2gb(br.region.name if br else br), str2gb(r.branch.name if r.branch else None), r.sn,
str2gb(r.name), str2gb(r.spec),str2gb(r.budget), str2gb(r.paid), str2gb(r.contract),
str2gb(r.contract_start), str2gb(r.contract_end),
str2gb(r.supplier), str2gb(r.service_phone), str2gb(r.owner if r.owner else None),
str2gb(r.owner.phone if r.owner else None),
str2gb(r.description)])
return response

0 comments on commit 0cdaef9

Please sign in to comment.