eonvelope.views.timezone module

Module with views for working with timezones in Eonvelope project.

eonvelope.views.timezone.set_timezone(request)[source]

Redirect to a given URL while setting the chosen timezone in the session.

The URL and the timezone code need to be specified in the request parameters.

Since this view changes how the user will see the rest of the site, it must only be accessed as a POST request. If called as a GET request, it will redirect to the page in the request (the ‘next’ parameter) without changing any state.

Note

Analogous to django.views.i18n.get_language().

Return type:

HttpResponse

Parameters:

request (HttpRequest)

eonvelope.views.timezone.check_for_timezone(timezone_code)[source]

Check the timezone code for validity and availability.

Parameters:
  • timezone. (The code of the)

  • timezone_code (str)

Return type:

bool

Returns:

Whether the timezone code is valid and the tz data available.s