Skip to content

Commit

Permalink
Refactor: Fix error raised by linter
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankApiyo committed Aug 8, 2023
1 parent 1daac11 commit 9b3ae09
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions onadata/apps/api/viewsets/xform_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ def data_import(self, request, *args, **kwargs):

else:
if xls_file and xls_file.name.split(".")[-1] in XLS_EXTENSIONS:
xls_file_name = xls_file.name
csv_file = submission_xls_to_csv(xls_file)
overwrite = request.query_params.get("overwrite")
overwrite = (
Expand All @@ -706,10 +705,7 @@ def data_import(self, request, *args, **kwargs):
)
else:
csv_file.seek(0)
if hasattr(csv_file, "name"):
file_name = csv_file.name
else:
file_name = xls_file_name
file_name = getattr(csv_file, "name", xls_file and xls_file.name)
upload_to = os.path.join(
request.user.username, "csv_imports", file_name
)
Expand Down

0 comments on commit 9b3ae09

Please sign in to comment.