Consolidate the approval code for Edit Pub (mod/pa_update.py) and Delete Pub (mod/pa_delete.py). At the moment, they both have "deleteAuthor" functions which do the same thing, although the execution is somewhat different. The version in pa_delete gets the author_id as the first parameter while the version in pa_update gets the author's canonical name as the first parameter. The latter can be easily changed to author_id in the calling code, i.e. line 648:
query = "select authors.author_canonical from authors,pub_authors where authors.author_id=pub_authors.author_id and pub_authors.pub_id='%d';" % (int(Record))
We'll just need to change "author_canonical" to "author_id" in the query. Once that's done, the two functions can be consolidated and, most likely, moved to a class.
Anonymous