Closed jcal22 closed 5 years ago
Yeah, I figured. The trailing space is ugly, but I couldn't figure out a cleaner way to iterate through the if-elif tree incase it wasn't empty, but didn't have the current wishlist it was looking to add.
The problem with the join command was that it needed to be passed a list, not two strings. Correct syntax is ' '.join([bookmatch["Requester"], book["dispname"]]) - note the extra square brackets. You could also add a .strip() to get rid of excess spaces ' '.join([bookmatch["Requester"].strip(), book["dispname"].strip()]) Depends how far you want to take it :-)
' '.join(bookmatch["Requester"], book["dispname"])} was throwing errors.
2018-10-17 08:38:15 ERROR WEBSERVER searchrss.py search_wishlist 257 Unhandled exception in search_wishlist: Traceback (most recent call last): File "C:\LazyLibrarian\lazylibrarian\searchrss.py", line 80, in search_wishlist newValueDict = {"Requester": ' '.join(bookmatch["Requester"], book["dispname"])} TypeError: join() takes exactly one argument (2 given)