cleanup: few fixes

This commit is contained in:
RhodeCode Admin 2023-07-27 17:07:36 +02:00
parent 2ee24ea13c
commit 8a427f4a24
3 changed files with 13 additions and 6 deletions

View file

@ -994,7 +994,7 @@ class Page(CustomPager):
def __init__(self, collection, page=1, items_per_page=20, item_count=None,
url_maker=None, **kwargs):
"""
Special type of pager. We intercept collection to wrap it in our custom
Special type of pager. We intercept a collection to wrap it in our custom
logic instead of using wrapper_class
"""
@ -1011,14 +1011,20 @@ class SqlPage(CustomPager):
def __init__(self, collection, page=1, items_per_page=20, item_count=None,
url_maker=None, **kwargs):
"""
Special type of pager. We intercept collection to wrap it in our custom
Special type of pager. We intercept a collection to wrap it in our custom
logic instead of using wrapper_class
"""
collection = SqlalchemyOrmWrapper(self, collection)
super(SqlPage, self).__init__(collection=collection, page=page,
items_per_page=items_per_page, item_count=item_count,
wrapper_class=None, url_maker=url_maker, **kwargs)
super().__init__(
collection=collection,
page=page,
items_per_page=items_per_page,
item_count=item_count,
wrapper_class=None,
url_maker=url_maker,
**kwargs
)
class RepoCommitsWrapper(object):

View file

@ -192,6 +192,7 @@ class NotificationModel(BaseModel):
elif filter_:
q = q.filter(Notification.type_.in_(filter_))
q = q.order_by(Notification.created_on.desc())
return q
def mark_read(self, user, notification):

View file

@ -54,7 +54,7 @@ GIT_REPO_WITH_GROUP = f'{REPO_GROUP}/{GIT_REPO}'
log = logging.getLogger(__name__)
# Docker image running httpbin...
HTTPBIN_DOMAIN = 'http://httpbin'
HTTPBIN_DOMAIN = 'http://httpbin:9090'
HTTPBIN_POST = HTTPBIN_DOMAIN + '/post'