password reset text

35 views
Skip to first unread message

Tom Lord

unread,
Mar 28, 2013, 6:51:27 AM3/28/13
to econsens...@googlegroups.com
Hey Phil,


> I've changed the password reset email (for this task)
> <https://aptivate.kanbantool.com/boards/5986#tasks-1194097> - I used the
> evernote password reset email as a template. This is what I've done:
> https://github.com/philmcmahon/econsensus/commit/3fe9593298f4de5e30130f8dc2af6bdc2319ac22
> The template doesn't have any variables in it any more, I'm not sure
> whether it's necessary to have the users username or perhaps the
> organization(s) they belong to? I haven't found a clear way to pass
> extra context variables to the template (since password reset
> functionality is fromdjango.contrib.auth
> <https://github.com/django/django/blob/master/django/contrib/auth/views.py>
> ) but it must be possible somehow. But if you think the message is fine
> as it is (there's a sample in a comment to the commit on my fork) then
> I'll just submit a pull request, thought I'd check with you first!


Thanks!

The text looks much better to me, nice one.

I'm wondering how future-proof that fix is, with the hard-coded
"econsensus". Maybe if someone set up their own version of the software,
they might want to call it brilliant-decisions or something, rather than
econsensus :-) However we do have the logo already ... Jo, maybe you
can shed some architectural light on whether you think this is an issue
or not!

I think in general it's good to be as re-usable as possible. If at the
moment all someone would have to do is to change a logo to change the
name of the software, that sounds good. Making more "magic strings" that
they'd have to change feels like a departure from righteousness to me.
However if you can't find out how to access variables Phil, not sure
where to go.

We could think more about separating the name of the software from the
site itself. Not sure where to go with this at the moment.

> And I'm going to look at changing the feedback to just show the username
> (this task <https://aptivate.kanbantool.com/boards/5986#tasks-1222819>),
> looks like another easy win.
> So yep I've just been picking out the simpler tasks from the backlog,
> any suggestions are welcome too :-)

Sounds good, just let me know if you get lost! Unfortunately the kanban
seems to be down at the moment. The joy of web 2.0 tools.

cheers,
Tom.

--
Tom Lord | (to...@aptivate.org)

Aptivate | http://www.aptivate.org | Phone: +44 1223 967838
Future Business, Cambridge City FC, Milton Road, Cambridge CB4 1UY

Aptivate is a not-for-profit company registered in England and Wales
with company number 04980791.

Hamish Downer

unread,
Mar 28, 2013, 7:10:00 AM3/28/13
to econsensusdiscuss
> I'm wondering how future-proof that fix is, with the hard-coded
> "econsensus". Maybe if someone set up their own version of the software,
> they might want to call it brilliant-decisions or something, rather than
> econsensus :-) However we do have the logo already ... Jo, maybe you
> can shed some architectural light on whether you think this is an issue
> or not!

In general, these things should probably be in settings.py - and you
can put them in the context of all web pages using context processors.

Roll your own: http://stackoverflow.com/a/433209/3189
Use a library for multiple settings to context:
https://github.com/mfogel/django-settings-context-processor

So for the sight name, the logo etc the above would work fine. However
I think you're talking about emails, which are slightly different. Is
that right?

> Sounds good, just let me know if you get lost! Unfortunately the kanban
> seems to be down at the moment. The joy of web 2.0 tools.

I think this is a side effect of the massive DDOS that is going on at
the moment - sounds like it is particularly affecting traffic through
some London internet exchanges. That is why some sites are fine and
some are taking forever. More at:

http://arstechnica.com/security/2013/03/spamhaus-ddos-grows-to-internet-threatening-size/

Although zen appear to be affected more than my mobile internet or
virgin at home ...

Hamish

--
Hamish Downer | <ham...@aptivate.org> | Skype: dmishd

Jo Paulger

unread,
Mar 28, 2013, 8:31:15 AM3/28/13
to econsens...@googlegroups.com
Hi, 

Regarding the password reset email, I agree with you Tom about not hardcoding the site name - more details in the comments I just added to Phil's commit on github before I saw this email! Context processors that Hamish mentions are cool and worth a read about Phil, but not necessary in this case because the django/contrib/auth code provides you with a template variable called site_name which you can use in the body and subject templates.

I've had no trouble accessing the kanban today from home, but had heard vague rumours about some trouble on tinterwebs so thanks for the update Hamish.

Jo

--
You received this message because you are subscribed to the Google Groups "econsensusdiscuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to econsensusdisc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Jo Paulger

unread,
Mar 28, 2013, 9:17:33 AM3/28/13
to econsens...@googlegroups.com
On 28 March 2013 11:10, Hamish Downer <ham...@aptivate.org> wrote:
you
can put them in the context of all web pages using context processors.
 
So for the sight name, the logo etc the above would work fine.  However

I think you're talking about emails, which are slightly different.  Is
that right?

Yes, it's different. The django/contrib/auth code that renders the email template is as follows where c is a dictionary of context variables:

email = loader.render_to_string(email_template_name, c)

It appears that this bypasses consultation of the context processors, which for the rendering of screen templates is done in RequestContext's constructor.  

Thanks for the suggestion though :D

Jo
Reply all
Reply to author
Forward
0 new messages