Skip to content
Snippets Groups Projects
Commit e735fbdd authored by Jan Mach's avatar Jan Mach
Browse files

Fix: Minor fixes and improvements.

(Redmine issue: #3734)
parent 0e916daf
No related branches found
No related tags found
No related merge requests found
......@@ -360,7 +360,8 @@ class HawatBaseView(flask.views.View):
"""
raise NotImplementedError()
def can_access_endpoint(self, endpoint, item = None):
@staticmethod
def can_access_endpoint(endpoint, item = None):
"""
Check, that the current user can access given endpoint/view. This method
will also return ``False`` in case endpoint is not even registered within
......
......@@ -94,11 +94,13 @@ from flask_babel import gettext, lazy_gettext, force_locale
#
# Custom modules.
#
from mentat.datatype.sqldb import ItemChangeLogModel
import hawat.const
import hawat.base
import hawat.db
import hawat.forms
from hawat.models.user import GuiUserModel, ItemChangeLogModel
from hawat.models.user import GuiUserModel
from hawat.blueprints.auth_env.forms import RegisterUserAccountForm
......
......@@ -42,7 +42,7 @@
<tbody>
{%- if 'asn' in search_result['asn'] %}
<tr>
<th>{{ gettext('ANS number:') }}</th>
<th>{{ gettext('ASN number:') }}</th>
<td>{{ search_result['asn']['asn'] }}</td>
</tr>
{%- endif %}
......
......@@ -232,7 +232,7 @@ class ShowView(hawat.base.HawatItemShowView):
)
action_menu.add_entry(
'endpoint',
'show',
'search',
endpoint = '{}.search'.format(cls.module_name)
)
action_menu.add_entry(
......
......@@ -9,7 +9,7 @@
"""
This module contains custom internal geoip search form for Hawat.
This module contains custom event report search form for Hawat.
"""
......
......@@ -24,7 +24,6 @@
{{ macros_site.render_form_item_datetime(search_form.dt_to, 'datetimepicker-hm-to') }}
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-4">
{{ macros_site.render_form_item_select(search_form.groups) }}
......
......@@ -160,13 +160,11 @@ class AdminUserAccountForm(BaseUserAccountForm):
)
memberships = QuerySelectMultipleField(
lazy_gettext('Group memberships:'),
query_factory = get_available_groups,
allow_blank = True
query_factory = get_available_groups
)
managements = QuerySelectMultipleField(
lazy_gettext('Group managements:'),
query_factory = get_available_groups,
allow_blank = True
query_factory = get_available_groups
)
def __init__(self, *args, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment