Merge pull request #6645 from jumpserver/dev

Dev
pull/6697/head
Eric_Lee 2021-08-16 11:25:24 +08:00 committed by GitHub
commit e49dedf6b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -35,7 +35,8 @@ class ApplicationAccountViewSet(JMSModelViewSet):
http_method_names = ['get', 'put', 'patch', 'options']
def get_queryset(self):
queryset = ApplicationPermission.objects.all() \
queryset = ApplicationPermission.objects.exclude(system_users__isnull=True) \
.exclude(applications__isnull=True) \
.annotate(uid=Concat(
'applications', Value('_'), 'system_users', output_field=CharField()
)) \

View File

@ -68,6 +68,7 @@ class ApplicationSerializer(ApplicationSerializerMixin, BulkOrgResourceModelSeri
class ApplicationAccountSerializer(serializers.Serializer):
id = serializers.ReadOnlyField(label=_("Id"), source='uid')
username = serializers.ReadOnlyField(label=_("Username"))
password = serializers.CharField(write_only=True, label=_("Password"))
systemuser = serializers.ReadOnlyField(label=_('System user'))

7
utils/check_celery.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
if [[ "$(ps axu | grep 'celery' | grep -v 'grep' | grep -cv 'defunct')" == "5" ]];then
exit 0
else
exit 1
fi