Created
March 19, 2020 07:42
-
-
Save xb4dc0d3/4b6148f434d78a7197ca969f3e21c5d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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