Compare commits

...

3 commits

4 changed files with 7 additions and 23 deletions

View file

@ -1,23 +1,6 @@
#
# 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
#
# loops.organize.comment.browser
"""
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
@ -176,7 +159,8 @@ class CreateComment(EditObject):
rm = self.view.loopsRoot.getRecordManager()
ts = rm.get('comments')
if ts is None:
ts = addObject(rm, TrackingStorage, 'comments', trackFactory=Comment)
#ts = addObject(rm, TrackingStorage, 'comments', trackFactory=Comment)
rm['comments'] = ts = TrackingStorage(trackFactory=Comment)
uid = util.getUidForObject(self.object)
data = dict(subject=subject, text=text)
for k in ('name', 'email'):

View file

@ -7,7 +7,7 @@ from scopes.server import auth
from zope.authentication.interfaces import IAuthentication
from zope.component import getUtility, provideUtility
def registerAuthUtility():
def registerAuthUtility(config):
baseAuth = getUtility(IAuthentication)
print('*** registerAuthUtility, baseAuth:', baseAuth)
provideUtility(auth.JwtAuthentication(baseAuth))

View file

@ -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()
auth.registerAuthUtility(config)
run(app, config)
if __name__ == '__main__':

View file

@ -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()
auth.registerAuthUtility(config)
root = conn.root()['Application']
setSite(root)
sm = component.getSiteManager(root)