No validity checking on extra information

Bug #974558 reported by Jono Bacon
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Accomplishments Viewer
Confirmed
Medium
Unassigned

Bug Description

Today when entering extra information (e.g. launchpad-email) we do no validation checking (e.g. removing whitespace from an email address).

This begs the question, how do we determine how something should be formatted.

One possible solution here, as we ask accom set creators to copy a file from lp:ubuntu-accomplishments-extra-information is to put a formatting rule in the files from that branch. This could be something such as:

  formatting=nowhitespace

Or could include a regular expression. Thoughts?

Tags: bitesize
Jono Bacon (jonobacon)
Changed in ubuntu-accomplishments-system:
status: New → Confirmed
importance: Undecided → Medium
Jono Bacon (jonobacon)
affects: ubuntu-accomplishments-system → ubuntu-accomplishments-viewer
Revision history for this message
Brian Mastell (bmastell) wrote :

Maybe we could have predefined types so that the author doesn't have to worry about the details of formatting, like the html5 values for the 'type' attribute for the <input> tag, e.g. "email", "url", "date", etc...

   information-type=email
   information-type=url
   information-type=date

Some of the types could then allow the accomplishments-viewer to display them based on the client's localization settings.

Revision history for this message
Brian Mastell (bmastell) wrote :

If there's something the accom creator wants that doesn't fit one of the predefined types, they could define its formatting with a regex:

   information-type=custom
   information-format=^[0-9]{1}[A-Z]{3}[0-9]{3}$

Revision history for this message
Jono Bacon (jonobacon) wrote :

Some work went on a while back into providing an example of what the information should look like, and we discussed using a regex approach to solve this problem. My hunch is that the regex approach would be best. Thoughts?

Revision history for this message
Jono Bacon (jonobacon) wrote :

One other note: accomplishment authors would not need to know the regex details as we keep the different types of information known by Ubuntu Accomplishments in https://launchpad.net/ubuntu-accomplishments-extra-information and the author just copies the relevant file into their collection.

Revision history for this message
Rafał Cieślak (rafalcieslak256) wrote :

The daemon already exposes regex data for each bit of extra-information (if available). Therefore all that has to be done to fix this is add code to viewer's credentials edition window which will check if typed in value matches the regex.

This task may be recommended for a new contributor who is familiar with python, marking as bitesize.

tags: added: bitesize
Changed in ubuntu-accomplishments-viewer:
milestone: none → 0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.