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): ...@@ -360,7 +360,8 @@ class HawatBaseView(flask.views.View):
""" """
raise NotImplementedError() 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 Check, that the current user can access given endpoint/view. This method
will also return ``False`` in case endpoint is not even registered within 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 ...@@ -94,11 +94,13 @@ from flask_babel import gettext, lazy_gettext, force_locale
# #
# Custom modules. # Custom modules.
# #
from mentat.datatype.sqldb import ItemChangeLogModel
import hawat.const import hawat.const
import hawat.base import hawat.base
import hawat.db import hawat.db
import hawat.forms import hawat.forms
from hawat.models.user import GuiUserModel, ItemChangeLogModel from hawat.models.user import GuiUserModel
from hawat.blueprints.auth_env.forms import RegisterUserAccountForm from hawat.blueprints.auth_env.forms import RegisterUserAccountForm
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<tbody> <tbody>
{%- if 'asn' in search_result['asn'] %} {%- if 'asn' in search_result['asn'] %}
<tr> <tr>
<th>{{ gettext('ANS number:') }}</th> <th>{{ gettext('ASN number:') }}</th>
<td>{{ search_result['asn']['asn'] }}</td> <td>{{ search_result['asn']['asn'] }}</td>
</tr> </tr>
{%- endif %} {%- endif %}
......
...@@ -232,7 +232,7 @@ class ShowView(hawat.base.HawatItemShowView): ...@@ -232,7 +232,7 @@ class ShowView(hawat.base.HawatItemShowView):
) )
action_menu.add_entry( action_menu.add_entry(
'endpoint', 'endpoint',
'show', 'search',
endpoint = '{}.search'.format(cls.module_name) endpoint = '{}.search'.format(cls.module_name)
) )
action_menu.add_entry( action_menu.add_entry(
......
...@@ -9,7 +9,7 @@ ...@@ -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 @@ ...@@ -24,7 +24,6 @@
{{ macros_site.render_form_item_datetime(search_form.dt_to, 'datetimepicker-hm-to') }} {{ macros_site.render_form_item_datetime(search_form.dt_to, 'datetimepicker-hm-to') }}
</div> </div>
</div> </div>
<hr>
<div class="row"> <div class="row">
<div class="col-sm-4"> <div class="col-sm-4">
{{ macros_site.render_form_item_select(search_form.groups) }} {{ macros_site.render_form_item_select(search_form.groups) }}
......
...@@ -160,13 +160,11 @@ class AdminUserAccountForm(BaseUserAccountForm): ...@@ -160,13 +160,11 @@ class AdminUserAccountForm(BaseUserAccountForm):
) )
memberships = QuerySelectMultipleField( memberships = QuerySelectMultipleField(
lazy_gettext('Group memberships:'), lazy_gettext('Group memberships:'),
query_factory = get_available_groups, query_factory = get_available_groups
allow_blank = True
) )
managements = QuerySelectMultipleField( managements = QuerySelectMultipleField(
lazy_gettext('Group managements:'), lazy_gettext('Group managements:'),
query_factory = get_available_groups, query_factory = get_available_groups
allow_blank = True
) )
def __init__(self, *args, **kwargs): 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