← Back to team overview

ubuntu-accomplishments-contributors team mailing list archive

Re: Questions about share_id registration

 

2012/6/12 Janos Gyerik <info@xxxxxxxxxxx>

> Hi Gabriel,
>
> > I'm starting with the share id registration, and of course I have some
> > questions:
>
> Thanks a lot for looking into this!
>
> > As far as I can see in the accomplishments-shares directory, the share
> ids
> > have spaces, dashes, etc. Should we encode the share id in the url?
>
> I think the caller (desktop app) will need to encode the url, that's
> pretty much just the spaces. If you pass to django "?id=something with
> spaces-and-dashes,and commas" that will be correctly received in
> request.GET['id'] so I don't think we need to worry too much about
> this.
>
> > Should we show a confirmation page to accept the share id or do we just
> > redirect to the profile page were the user can pick/change a username?
> > Should we validate if the directory exists when getting a new share_id?
> > What about the WEBVIEW file?
>
> I think we should redirect to the profile page where:
> 1. the user can change username if they want (you implemented already)
> 2. the share id is shown, maybe show a warning if it is not a valid share
> id
>
> About importing share ids and the WEBVIEW file I owe you an
> explanation. I was thinking that in the long run parsing of the shares
> should be triggered when there is a change in the filesystem. In the
> short run we could do this simply periodically instead.
>
> The consequence of this is that by the time the user visits the page,
> his/her trophies are already parsed and cached in Django, gpg
> signature checked (IF user permitted so with WEBVIEW). If you take a
> look at the TrophyCache model, you'll see that it does not reference
> User or UserProfile, this way the trophies can be imported even before
> the user first logs into the gallery to create his/her account. (We
> could probably add a Foreign Key null=True at some point.)
>
> Makes sense?
>
> > We will have to validate it every time we show the user's trophies, so it
> > doesn't make much sense to validate it here, does it?
>
> No need to validate when registering the share id. But it will be nice
> to show on the profile page if nothing matches in TrophyCache (i.e.
> the provided share id is no good)
>
> > Is there a preferred url for the share registration?
>
> It's in the trello task itself:
> /user/addshare&id=Jono-534589345983459834589734598
> (This is how I "translated" from Jono's spec, as I think it makes
> sense for the django site)
>
> Thanks a lot, let me know if you need anything else!
> Janos
> --
> Janos Gyerik
> http://titan2x.com/
>



Thanks Janos, I'll take a look at the TrophyCache model to check how this
works. The rest of the questions are absolutely clear.

-- 
Gabriel E. Patiño
http://about.me/gepatino

References