add an overwrite option to generate_reset_code

RESOLVED FIXED

Status

RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: tarek, Assigned: tarek)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

8 years ago
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.
(Assignee)

Comment 2

8 years ago
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
Attachment #508755 - Flags: review?(telliott)
(Assignee)

Comment 3

8 years ago
Created attachment 508758 [details] [diff] [review]
add the overwrite option

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+
(Assignee)

Comment 5

8 years ago
yes agreed, we should have all node assignment related stuff on its own. 

I added bug 631166
(Assignee)

Comment 6

8 years ago
Done in http://hg.mozilla.org/services/server-core/rev/0eb30869907c
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.