Skip to content

Instantly share code, notes, and snippets.

@xb4dc0d3
Created March 19, 2020 07:42
Show Gist options
  • Save xb4dc0d3/4b6148f434d78a7197ca969f3e21c5d7 to your computer and use it in GitHub Desktop.
Save xb4dc0d3/4b6148f434d78a7197ca969f3e21c5d7 to your computer and use it in GitHub Desktop.
def invitation(user):
# ...
# Bad
def invite_supervisor_lembaga(lists_supervisor_lembaga: List[SupervisorLembaga]):
'''
Filter supervisor lembaga yang aktif dan kirim undangan
'''
for supevisor_lembaga in lists_supervisor_lembaga:
if supervisor_lembaga.active:
invitation(supervisor_lembaga)
# Good
def get_active_supervisor_lembaga(lists_supervisor_lembaga: List[SupervisorLembaga]):
'''
Filter supervisor_lembaga yang aktif
'''
return [supervisor_lembaga for supervisor_lembaga in lists_supervisor_lembaga if supervisor_lembaga.active]
def invite_supervisor_lembaga(lists_supervisor_lembaga: List[SupervisorLembaga]) -> None:
"""Send an email to a given list of clients.
"""
for supervisor_lembaga in lists_supervisor_lembaga:
invitation(supervisor_lembaga)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment