Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Commit 5543251

Browse files
committed
have a method to check is project the current one
1 parent f176f14 commit 5543251

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

pugdebug/models/projects.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ def __init__(self, project_name):
4040
def get_project_name(self):
4141
return self.project_name
4242

43+
def is_project_current(self):
44+
if has_setting('current_project'):
45+
current_project = get_setting('current_project')
46+
47+
if current_project == self.get_project_name():
48+
return True
49+
50+
return False
51+
4352
def get_settings(self):
4453
project_settings = {}
4554

@@ -54,13 +63,8 @@ def set_settings(self, new_settings):
5463
self.setValue(key, value)
5564

5665
def delete(self):
57-
project_name = self.get_project_name()
58-
59-
if has_setting('current_project'):
60-
current_project = get_setting('current_project')
61-
62-
if project_name == current_project:
63-
remove_setting('current_project')
66+
if self.is_project_current():
67+
remove_setting('current_project')
6468

6569
delete_project(self.get_project_name())
6670

0 commit comments

Comments
 (0)