Skip to content

Commit

Permalink
Bugfix: Can't print <login_id> for users without
Browse files Browse the repository at this point in the history
  • Loading branch information
dbosk committed Aug 10, 2023
1 parent 174cb26 commit bc8eac8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/canvaslms/hacks/canvasapi.nw
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ Now, we simply need to define a function to use as a drop-in replacement for
the [[__str__]] method.
<<define [[name_and_login]]>>=
def name_and_login(self):
return f"{self.name} <{self.login_id}>"
try:
return f"{self.name} <{self.login_id}>"
except AttributeError as err:
return f"{self.name} <>"
@

Then we simply need to replace the current [[__str__]] method with the new one
Expand Down

0 comments on commit bc8eac8

Please sign in to comment.