Skip to content

Commit

Permalink
Add shortcut to get group url
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed May 25, 2020
1 parent 977d4f2 commit b908afd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions isogeo_pysdk/models/workgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@
# ##################################

# standard library
import logging
import pprint

# submodels
from isogeo_pysdk.models.contact import Contact

# #############################################################################
# ########## Globals ###############
# ##################################

logger = logging.getLogger(__name__)


# #############################################################################
# ########## Classes ###############
Expand Down Expand Up @@ -465,6 +472,20 @@ def name(self) -> str:
else:
return None

def admin_url(self, url_base: str = "https://app.isogeo.com") -> str:
"""Returns the administration URL (https://app.isogeo.com) for this group.
:param str url_base: base URL of admin site. \
Defaults to: https://app.isogeo.com. Can also be https://manage.isogeo.com.
:rtype: str
"""
if self._id is None:
logger.warning("UUID is required to build admin URL")
return url_base

return "{}/groups/{}".format(url_base, self._id)

# -- METHODS -----------------------------------------------------------------------
def to_dict(self) -> dict:
"""Returns the model properties as a dict."""
Expand Down

0 comments on commit b908afd

Please sign in to comment.