Clan VM Manager: detect if clan exists
All checks were successful
checks-impure / test (pull_request) Successful in 1m48s
checks / test (pull_request) Successful in 2m52s

This commit is contained in:
Johannes Kirschbauer 2024-02-07 16:08:48 +07:00
parent 045c5e608b
commit 030cbd24ce
Signed by: hsjobeki
SSH Key Fingerprint: SHA256:vX3utDqig7Ph5L0JPv87ZTPb/w7cMzREKVZzzLFg9qU
2 changed files with 3 additions and 4 deletions

View File

@ -116,10 +116,8 @@ class ClanURI:
def get_full_uri(self) -> str:
return self._full_uri
# TODO(@Qubasa): return a comparable id e.g. f"{url}#{attr}"
# This should be our standard.
def get_id(self) -> str:
return f"{self._components.path}#{self._components.fragment}"
return f"{self.get_internal()}#{self.params.flake_attr}"
@classmethod
def from_path(

View File

@ -188,7 +188,8 @@ class ClanList(Gtk.Box):
row.add_css_class("trust")
# TODO: figure out how to detect that
if True:
exist = VMS.use().get_by_id(item.url.get_id())
if exist:
row.set_subtitle("Clan already exists. Joining again will update it")
avatar = Adw.Avatar()