|
1 | | -# $Id: client.py,v 1.176.2.7 2004-11-05 04:57:50 richard Exp $ |
| 1 | +# $Id: client.py,v 1.176.2.8 2004-11-21 21:52:34 richard Exp $ |
2 | 2 |
|
3 | 3 | """WWW request handler (also used in the stand-alone server). |
4 | 4 | """ |
@@ -187,15 +187,12 @@ def inner_main(self): |
187 | 187 | self.ok_message = [] |
188 | 188 | self.error_message = [] |
189 | 189 | try: |
190 | | - # figure out the context and desired content template |
191 | | - # do this first so we don't authenticate for static files |
192 | | - # Note: this method opens the database as "admin" in order to |
193 | | - # perform context checks |
194 | | - self.determine_context() |
195 | | - |
196 | 190 | # make sure we're identified (even anonymously) |
197 | 191 | self.determine_user() |
198 | 192 |
|
| 193 | + # figure out the context and desired content template |
| 194 | + self.determine_context() |
| 195 | + |
199 | 196 | # possibly handle a form submit action (may change self.classname |
200 | 197 | # and self.template, and may also append error/ok_messages) |
201 | 198 | html = self.handle_action() |
@@ -401,9 +398,6 @@ def determine_context(self, dre=re.compile(r'([^\d]+)(\d+)')): |
401 | 398 | # send the file identified by the designator in path[0] |
402 | 399 | raise SendFile, path[0] |
403 | 400 |
|
404 | | - # we need the db for further context stuff - open it as admin |
405 | | - self.opendb('admin') |
406 | | - |
407 | 401 | # see if we got a designator |
408 | 402 | m = dre.match(self.classname) |
409 | 403 | if m: |
@@ -435,7 +429,6 @@ def serve_file(self, designator, dre=re.compile(r'([^\d]+)(\d+)')): |
435 | 429 | raise NotFound, str(designator) |
436 | 430 | classname, nodeid = m.group(1), m.group(2) |
437 | 431 |
|
438 | | - self.opendb('admin') |
439 | 432 | klass = self.db.getclass(classname) |
440 | 433 |
|
441 | 434 | # make sure we have the appropriate properties |
|
0 commit comments