← Back to team overview

ubuntu-accomplishments-contributors team mailing list archive

changed the way to set user shares in the web gallery

 

Hi,

As discussed on IRC, the viewer cannot really know the complete
directory name of the user share, which looks like:
jono Trophies Folder (1339532999.45) (The Matrix,
fae2e7d2-2300-4f15-89d6-1af6e6782fe1)

The viewer knows this:
share_id = fae2e7d2-2300-4f15-89d6-1af6e6782fe1
share_name = jono Trophies Folder (1339532999.45)

So I adjusted the gallery, and from now on the registration url should
look like this:
/user/addshare?share_name=jono Trophies Folder
(1339532999.45)&share_id=fae2e7d2-2300-4f15-89d6-1af6e6782fe1

To prevent cheats like:
/user/addshare?share_name=jono.*&share_id=.*
... the gallery performs some pretty strict pattern matching, so if
anything changes in the share directory naming scheme, the gallery too
will need to be updated accordingly, otherwise the share directory
names will not match and trophies cannot be associated.

Michael, for this I had to change the model, so you will need to make
changes to the database on the test site. Since the site is in
pre-beta, I think a proper migration would be overkill, so I recommend
to simply drop and recreate / reimport the affected tables:

    echo drop users_userprofile | ./manage.py dbshell
    echo drop common_trophycache | ./manage.py dbshell
    ./manage.py syncdb
    ./manage.py import_trophies

Jono, Rafal, you will need to visit /user/addshare?... with the right
parameters again to re-establish the association again between your
django profile and trophies share.

Let me know if any of this is not clear enough!

Cheers,
Janos

PS: for folks who haven't seen the test site yet, check this out:
http://213.138.100.229:8000/gallery/trophies/jonobacon/latest/
-- 
Janos Gyerik
http://www.janosgyerik.com/


Follow ups