Skip to content

Commit

Permalink
Print stats in right order
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiencyr committed Oct 9, 2021
1 parent e318709 commit c155bf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/vorta/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@ class Meta:
database = db

@classmethod
def get_repo(cls, profile_id, repo_url):
def get_repo(cls, profile_id: int, repo_url: str):
"""
Return the repo associated with current profile. repo_url is a string.
Return the repo associated with current profile or None if the repo doesn't exist.
If the profile doesn't exist, None is returned too.
"""
query = cls \
.select(cls, RepoModel).join(RepoModel) \
Expand Down
8 changes: 2 additions & 6 deletions src/vorta/views/repo_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,8 @@ def init_repo_stats(self):
unique_size = ''
total_size = ''
encryption = ''

query = BackupProfileMixin.get_repos(profile)

for prof_x_repos in query:
repo = prof_x_repos.repo
if repo is not None:
for repo in RepoModel.select():
if BackupProfileMixin.get_repo(profile, repo.url) is not None:
unique_csize += pretty_bytes(repo.unique_csize)
unique_size += pretty_bytes(repo.unique_size)
total_size += pretty_bytes(repo.total_size)
Expand Down

0 comments on commit c155bf2

Please sign in to comment.