Skip to content

Commit

Permalink
setting proper data path moved to the save method
Browse files Browse the repository at this point in the history
  • Loading branch information
sheenaze committed Sep 8, 2023
1 parent 097ae2a commit 2f2d8e5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions validator/models/user_dataset_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ def file_size(self):
return

def delete_dataset_file(self):
# set storage path to an empty string
self.dataset.storage_path = ''
self.dataset.save()
# # set storage path to an empty string
# clear all the user management groups if there are no validations run by other users
if self.number_of_other_users_validations == 0:
self.user_groups.clear()
Expand All @@ -83,8 +81,7 @@ def delete_dataset_file(self):
self.save()

def save(self, *args, **kwargs):

self.dataset.storage_path = self.file.path
self.dataset.storage_path = "" if not self.file else self.file.path
self.dataset.save()

super(UserDatasetFile, self).save(*args, **kwargs)
Expand Down

0 comments on commit 2f2d8e5

Please sign in to comment.