Merge lp://staging/~doanac/qa-dashboard/tastypie-settings-wsgi into lp://staging/qa-dashboard

Proposed by Andy Doan
Status: Merged
Approved by: Chris Johnston
Approved revision: 704
Merged at revision: 704
Proposed branch: lp://staging/~doanac/qa-dashboard/tastypie-settings-wsgi
Merge into: lp://staging/qa-dashboard
Diff against target: 38 lines (+11/-12)
2 files modified
qa_dashboard/settings.py (+0/-12)
smokeng/api.py (+11/-0)
To merge this branch: bzr merge lp://staging/~doanac/qa-dashboard/tastypie-settings-wsgi
Reviewer Review Type Date Requested Status
Chris Johnston Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+199030@code.staging.launchpad.net

Commit message

moves the tasypie hack out of settings.py logic. settings.py can't really be expected to deal with imports of django libraries when run outside of manage.py (ie gunicorn and wsgi.py)

Description of the change

moves the tasypie hack out of settings.py logic. settings.py can't really be expected to deal with imports of django libraries when run outside of manage.py (ie gunicorn and wsgi.py)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:704
http://s-jenkins.ubuntu-ci:8080/job/dashboard-ci/280/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/dashboard-ci/280/rebuild

review: Approve (continuous-integration)
Revision history for this message
Chris Johnston (cjohnston) wrote :

 review approve
 merge approved

On Sat, Dec 14, 2013 at 4:59 PM, Andy Doan <email address hidden>wrote:

> Andy Doan has proposed merging
> lp:~doanac/qa-dashboard/tastypie-settings-wsgi into lp:qa-dashboard.
>
> Commit message:
> moves the tasypie hack out of settings.py logic. settings.py can't really
> be expected to deal with imports of django libraries when run outside of
> manage.py (ie gunicorn and wsgi.py)
>
> Requested reviews:
> Canonical CI Engineering (canonical-ci-engineering)
>
> For more details, see:
>
> https://code.launchpad.net/~doanac/qa-dashboard/tastypie-settings-wsgi/+merge/199030
>
> moves the tasypie hack out of settings.py logic. settings.py can't really
> be expected to deal with imports of django libraries when run outside of
> manage.py (ie gunicorn and wsgi.py)
> --
>
> https://code.launchpad.net/~doanac/qa-dashboard/tastypie-settings-wsgi/+merge/199030
> Your team QA Dashboard Developers is subscribed to branch lp:qa-dashboard.
>
> === modified file 'qa_dashboard/settings.py'
> --- qa_dashboard/settings.py 2013-12-12 05:37:09 +0000
> +++ qa_dashboard/settings.py 2013-12-14 21:58:28 +0000
> @@ -324,15 +324,3 @@
> pass
>
> INSTALLED_APPS = PLUGIN_APPS + LOCAL_APPS + INSTALLED_APPS
> -
> -
> -# for tastypie, a hack to allow us to not require using TZ:
> -#
> http://github.com/toastdriven/django-tastypie/pull/561#issuecomment-26204496
> -def _now():
> - from django.utils import timezone
> - d = timezone.now()
> - if d.tzinfo:
> - d = timezone.localtime(timezone.now())
> - return d
> -import tastypie.models
> -tastypie.models.ApiKey._meta.get_field_by_name('created')[0].default =
> _now
>
> === modified file 'smokeng/api.py'
> --- smokeng/api.py 2013-11-21 17:46:02 +0000
> +++ smokeng/api.py 2013-12-14 21:58:28 +0000
> @@ -117,3 +117,14 @@
> v1_api.register(JenkinsBuildResource())
> v1_api.register(SmokeImageResource())
> v1_api.register(SmokeResultResource())
> +
> +# for tastypie, a hack to allow us to not require using TZ:
> +#
> http://github.com/toastdriven/django-tastypie/pull/561#issuecomment-26204496
> +def _now():
> + from django.utils import timezone
> + d = timezone.now()
> + if d.tzinfo:
> + d = timezone.localtime(timezone.now())
> + return d
> +import tastypie.models
> +tastypie.models.ApiKey._meta.get_field_by_name('created')[0].default =
> _now
>
>
>

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches