Closed Bug 630376 Opened 13 years ago Closed 13 years ago

add an overwrite option to generate_reset_code

Categories

(Cloud Services :: Server: Core, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tarek, Assigned: tarek)

Details

Attachments

(1 file, 1 obsolete file)

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.
Attached patch add the ovewrite option (obsolete) — Splinter Review
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
Attachment #508755 - Flags: review?(telliott)
Forgot to include a test file in the patch
Attachment #508755 - Attachment is obsolete: true
Attachment #508758 - Flags: review?(telliott)
Attachment #508755 - Flags: review?(telliott)
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
Done in http://hg.mozilla.org/services/server-core/rev/0eb30869907c
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: