Conversation
|
|
||
|
|
||
| DEFAULT_ORG_DETAILS = { | ||
| u'access_token': buid(), |
There was a problem hiding this comment.
This is declaring a fixed access token as a global.
|
|
||
| class OrgForm(forms.Form): | ||
| contact_email = forms.EmailField(__("Contact email"), | ||
| validators=[forms.validators.DataRequired(__("Please enter an email address")), forms.validators.Length(min=5, max=80)]) |
There was a problem hiding this comment.
Use an email validator instead of a length validator.
| # so assign a default value of `{}` | ||
| if not data or data == 'null': | ||
| return json.dumps({}) | ||
| return data |
There was a problem hiding this comment.
So it doesn't format JSON if the request is not a GET? That doesn't make sense.
There was a problem hiding this comment.
The formatting with indents is only to make it easy for the admin to edit it. simplejson fails when the formatted version is supplied via populate_obj.
There was a problem hiding this comment.
I mean the "return data" bit. It's returning the Python data object if the request is not a GET? Why?
There was a problem hiding this comment.
That's because json.dumps(data) will result in a JSON string, which errors out when I attempt to store it in the database. Since it expects a dict, I just return the data dict.
| return render_message( | ||
| title=_(u"No organizations available"), | ||
| message=_(u"To setup Boxoffice for an organization, you must be the owner of the organization.")) | ||
|
|
There was a problem hiding this comment.
Use the logic used in Funnel's /new handler. This code looks fragile.
There was a problem hiding this comment.
It's mostly borrowed from there. https://github.com/hasgeek/funnel/blob/master/funnel/views/profile.py#L34
There was a problem hiding this comment.
Damn, then that needs to be tossed as well. We can live with this for now, knowing that both places will need to be changed after hasgeek/lastuser#232.
|
Bibhas seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
No description provided.