Skip to content

Commit

Permalink
remove get_link from record
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewduckett committed Oct 7, 2024
1 parent d124b85 commit 5be0795
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions pysnc/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ def set_link(self, field, value):
else:
c[field].set_link(value)

def get_link(self, no_stack=False, field=None) -> str:
def get_link(self, no_stack=False) -> str:
"""
Generate a full URL to the current record. sys_id will be null if there is no current record.
Expand All @@ -832,16 +832,13 @@ def get_link(self, no_stack=False, field=None) -> str:
:return: The full URL to the current record
:rtype: str
"""
if field is not None:
return self._get_value(field, 'link')
else:
ins = self._client.instance
obj = self._current()
stack = '&sysparm_stack=%s_list.do?sysparm_query=active=true' % self.__table
if no_stack:
stack = ''
id = self.sys_id if obj else 'null'
return "{}/{}.do?sys_id={}{}".format(ins, self.__table, id, stack)
ins = self._client.instance
obj = self._current()
stack = '&sysparm_stack=%s_list.do?sysparm_query=active=true' % self.__table
if no_stack:
stack = ''
id = self.sys_id if obj else 'null'
return "{}/{}.do?sys_id={}{}".format(ins, self.__table, id, stack)

def get_link_list(self) -> Optional[str]:
"""
Expand Down

0 comments on commit 5be0795

Please sign in to comment.