Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
58ad25d0
Commit
58ad25d0
authored
10 years ago
by
Jeremy Kersten
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] website_event - Check that template exists before to render it
parent
a4bc65cd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addons/website_event/controllers/main.py
+11
-0
11 additions, 0 deletions
addons/website_event/controllers/main.py
with
11 additions
and
0 deletions
addons/website_event/controllers/main.py
+
11
−
0
View file @
58ad25d0
...
...
@@ -34,6 +34,7 @@ import time
from
dateutil.relativedelta
import
relativedelta
from
openerp
import
tools
import
werkzeug.urls
from
werkzeug.exceptions
import
NotFound
try
:
import
GeoIP
...
...
@@ -175,6 +176,16 @@ class website_event(http.Controller):
'
event
'
:
event
,
'
main_object
'
:
event
}
if
'
.
'
not
in
page
:
page
=
'
website_event.%s
'
%
page
try
:
request
.
website
.
get_template
(
page
)
except
ValueError
,
e
:
# page not found
raise
NotFound
return
request
.
website
.
render
(
page
,
values
)
@http.route
([
'
/event/<model(
"
event.event
"
):event>
'
],
type
=
'
http
'
,
auth
=
"
public
"
,
website
=
True
,
multilang
=
True
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment