if overwrite is False, returns an existing code if any. if overwrite is True or no code exists, creates and returns a new code also, rename generate_reset_code to get_reset_code in the process
I believe that "no code exists" should default to false. i.e. semantically, you need to tell the server to overwrite.
Created attachment 508755 [details] [diff] [review] add the ovewrite option Added the overwrite option. also externalized the reset code managment to its own module so all backends can share it. the sql backend just overrides the minimal set of methods to store the reset code in the users tables instead of a dedicated table. Will do the renaming later
Created attachment 508758 [details] [diff] [review] add the overwrite option Forgot to include a test file in the patch
Comment on attachment 508758 [details] [diff] [review] add the overwrite option Looks good. I like having the reset stuff in its own space. As an aside, since you touch on it here, we should talk about using an API to the node assignment module for node assignments, which would let us abstract all node code out of the user api (hopefully to eventually include the node api call). That's beyond the scope of this bug.
Attachment #508758 - Flags: review?(telliott) → review+
yes agreed, we should have all node assignment related stuff on its own. I added bug 631166
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.