Compare commits
3 commits
74a3f9210b
...
b8ce799b12
Author | SHA1 | Date | |
---|---|---|---|
b8ce799b12 | |||
c0fc7fd464 | |||
e01a7362f9 |
4 changed files with 7 additions and 23 deletions
|
@ -1,23 +1,6 @@
|
||||||
#
|
# 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
|
from zope import interface, component
|
||||||
|
@ -176,7 +159,8 @@ class CreateComment(EditObject):
|
||||||
rm = self.view.loopsRoot.getRecordManager()
|
rm = self.view.loopsRoot.getRecordManager()
|
||||||
ts = rm.get('comments')
|
ts = rm.get('comments')
|
||||||
if ts is None:
|
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)
|
uid = util.getUidForObject(self.object)
|
||||||
data = dict(subject=subject, text=text)
|
data = dict(subject=subject, text=text)
|
||||||
for k in ('name', 'email'):
|
for k in ('name', 'email'):
|
||||||
|
|
|
@ -7,7 +7,7 @@ from scopes.server import auth
|
||||||
from zope.authentication.interfaces import IAuthentication
|
from zope.authentication.interfaces import IAuthentication
|
||||||
from zope.component import getUtility, provideUtility
|
from zope.component import getUtility, provideUtility
|
||||||
|
|
||||||
def registerAuthUtility():
|
def registerAuthUtility(config):
|
||||||
baseAuth = getUtility(IAuthentication)
|
baseAuth = getUtility(IAuthentication)
|
||||||
print('*** registerAuthUtility, baseAuth:', baseAuth)
|
print('*** registerAuthUtility, baseAuth:', baseAuth)
|
||||||
provideUtility(auth.JwtAuthentication(baseAuth))
|
provideUtility(auth.JwtAuthentication(baseAuth))
|
||||||
|
|
|
@ -23,7 +23,7 @@ def main():
|
||||||
zope_conf = getattr(config, 'zope_conf', 'zope.conf')
|
zope_conf = getattr(config, 'zope_conf', 'zope.conf')
|
||||||
print(f'starting loops server... - conf: {zope_conf}')
|
print(f'starting loops server... - conf: {zope_conf}')
|
||||||
app = getWSGIApplication(zope_conf)
|
app = getWSGIApplication(zope_conf)
|
||||||
auth.registerAuthUtility()
|
auth.registerAuthUtility(config)
|
||||||
run(app, config)
|
run(app, config)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -68,7 +68,7 @@ def setup(zope_conf=None, loopsRootPath=None, config=config):
|
||||||
if conn is None:
|
if conn is None:
|
||||||
print(f'opening ZODB connection...')
|
print(f'opening ZODB connection...')
|
||||||
conn = db.open()
|
conn = db.open()
|
||||||
auth.registerAuthUtility()
|
auth.registerAuthUtility(config)
|
||||||
root = conn.root()['Application']
|
root = conn.root()['Application']
|
||||||
setSite(root)
|
setSite(root)
|
||||||
sm = component.getSiteManager(root)
|
sm = component.getSiteManager(root)
|
||||||
|
|
Loading…
Add table
Reference in a new issue