kopia lustrzana https://github.com/OpenDroneMap/WebODM
Add UI_MAX_PROCESSING_NODES setting
rodzic
c54857d6e9
commit
c6d4c763f0
|
@ -1,5 +1,6 @@
|
|||
from django import template
|
||||
from guardian.shortcuts import get_objects_for_user
|
||||
from webodm import settings
|
||||
|
||||
from nodeodm.models import ProcessingNode
|
||||
|
||||
|
@ -8,7 +9,11 @@ register = template.Library()
|
|||
|
||||
@register.simple_tag(takes_context=True)
|
||||
def get_visible_processing_nodes(context):
|
||||
return get_objects_for_user(context['request'].user, "nodeodm.view_processingnode", ProcessingNode, accept_global_perms=False)
|
||||
queryset = get_objects_for_user(context['request'].user, "nodeodm.view_processingnode", ProcessingNode, accept_global_perms=False)
|
||||
if settings.UI_MAX_PROCESSING_NODES is not None:
|
||||
return queryset[:settings.UI_MAX_PROCESSING_NODES]
|
||||
else:
|
||||
return queryset
|
||||
|
||||
|
||||
@register.simple_tag(takes_context=True)
|
||||
|
|
|
@ -398,6 +398,8 @@ RESET_PASSWORD_LINK = ''
|
|||
# from an account that is exceeding a disk quota
|
||||
QUOTA_EXCEEDED_GRACE_PERIOD = 8
|
||||
|
||||
# Maximum number of processing nodes to show in the "Processing Nodes" menu
|
||||
UI_MAX_PROCESSING_NODES = None
|
||||
|
||||
if TESTING or FLUSHING:
|
||||
CELERY_TASK_ALWAYS_EAGER = True
|
||||
|
|
Ładowanie…
Reference in New Issue