Compare commits
	
		
			No commits in common. "b8ce799b12d5be3ea0a8b568c2168857813e1ba7" and "74a3f9210be0f7dfd22111f4e139d624a59a2353" have entirely different histories.
		
	
	
		
			b8ce799b12
			...
			74a3f9210b
		
	
		
					 4 changed files with 23 additions and 7 deletions
				
			
		|  | @ -1,6 +1,23 @@ | |||
| # loops.organize.comment.browser | ||||
| # | ||||
| #  Copyright (c) 2014 Helmut Merz helmutm@cy55.de | ||||
| # | ||||
| #  This program is free software; you can redistribute it and/or modify | ||||
| #  it under the terms of the GNU General Public License as published by | ||||
| #  the Free Software Foundation; either version 2 of the License, or | ||||
| #  (at your option) any later version. | ||||
| # | ||||
| #  This program is distributed in the hope that it will be useful, | ||||
| #  but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| #  GNU General Public License for more details. | ||||
| # | ||||
| #  You should have received a copy of the GNU General Public License | ||||
| #  along with this program; if not, write to the Free Software | ||||
| #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA | ||||
| # | ||||
| 
 | ||||
| """ Definition of view classes and other browser related stuff for comments. | ||||
| """ | ||||
| Definition of view classes and other browser related stuff for comments. | ||||
| """ | ||||
| 
 | ||||
| from zope import interface, component | ||||
|  | @ -159,8 +176,7 @@ class CreateComment(EditObject): | |||
|         rm = self.view.loopsRoot.getRecordManager() | ||||
|         ts = rm.get('comments') | ||||
|         if ts is None: | ||||
|             #ts = addObject(rm, TrackingStorage, 'comments', trackFactory=Comment) | ||||
|             rm['comments'] = ts = TrackingStorage(trackFactory=Comment) | ||||
|             ts = addObject(rm, TrackingStorage, 'comments', trackFactory=Comment) | ||||
|         uid = util.getUidForObject(self.object) | ||||
|         data = dict(subject=subject, text=text) | ||||
|         for k in ('name', 'email'): | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ from scopes.server import auth | |||
| from zope.authentication.interfaces import IAuthentication | ||||
| from zope.component import getUtility, provideUtility | ||||
| 
 | ||||
| def registerAuthUtility(config): | ||||
| def registerAuthUtility(): | ||||
|     baseAuth = getUtility(IAuthentication) | ||||
|     print('*** registerAuthUtility, baseAuth:', baseAuth) | ||||
|     provideUtility(auth.JwtAuthentication(baseAuth)) | ||||
|  |  | |||
|  | @ -23,7 +23,7 @@ def main(): | |||
|     zope_conf = getattr(config, 'zope_conf', 'zope.conf') | ||||
|     print(f'starting loops server... - conf: {zope_conf}') | ||||
|     app = getWSGIApplication(zope_conf) | ||||
|     auth.registerAuthUtility(config) | ||||
|     auth.registerAuthUtility() | ||||
|     run(app, config) | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|  |  | |||
|  | @ -68,7 +68,7 @@ def setup(zope_conf=None, loopsRootPath=None, config=config): | |||
|     if conn is None: | ||||
|         print(f'opening ZODB connection...') | ||||
|         conn = db.open() | ||||
|     auth.registerAuthUtility(config) | ||||
|     auth.registerAuthUtility() | ||||
|     root = conn.root()['Application'] | ||||
|     setSite(root) | ||||
|     sm = component.getSiteManager(root) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue