Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #780 (closed enhancement: fixed)

Opened 13 years ago

Last modified 12 years ago

patch attempt (non functional) at making identity more adaptable

Reported by: jvanasco@… Owned by: anonymous
Priority: normal Milestone: 0.9a5
Component: Identity Version: 0.9a4
Severity: normal Keywords:


The current Identity schema requires both a user_name and a user_email.

I dislike that, because while on some projects I want users to have both, on many I want the user to have one or the other.

Someone submitted a patch earlier that makes email not-required , which is great for their application, but doesn't work for mine - it still requires a unique user submitted id name.

my attached patch doesn't work - I couldnt get things quite right, but it presents a different approach that hopefully someone else can take over or help me complete

let me just elaborate on the idea a_ app.cfg

the setting for identity.form.user_name is changed to 'account_identifier', which can either be 'user_name' or 'user_email' we add a 'identity.account_identifier' setting that can either be 'user_name' or 'user_email' . this represents the primary unique idfield. we add 'required.user_email' and 'required.user_name' boolean options - should these fields be required?

b_ visitor.py

references to user_name are replaced with account_identifier

c_ so/sa providor

essentially, _get_user_name becomes _get_account_identifier i tried to make things backwards compatible (perhaps too much) , so 'user_name' is still stored in some places (as is user_email'), but only in addition to account_identifier i upped user_name from 16 to 255 characters. user_email and display_name are both 255. I hope at least this idea is accepted - it would at least give people the chance to put an email address in user_name (although that would be really confusing) i wasn't sure if this would work or not, but if possible, i think we should set alternateId, alternateIdMethod in TG user based on the settings in app.cfg

hopefully, an approach like this will accomplish the following: a- have no impact on people already using identity b- let people use user_name as the primary id (and omit user_email) c- let people use user_email as the primary id (and omit user_name) d- let people use both user_name and user_email


tg_svn.diff Download (13.8 KB) - added by anonymous 13 years ago.

Change History

Changed 13 years ago by anonymous

comment:1 Changed 13 years ago by jorge.vargas

then someone else will come and say, I don't like your aproach and summit yet another patch


comment:2 Changed 13 years ago by kevin

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 0.9a5

The identity model has moved to quickstart, so the user can just edit model.py as they please.

Note: See TracTickets for help on using tickets.