Beispiel #1
0
    def post(self, request, *args, **kwargs):
        stuck_reg = self.get_object()
        if Registration.find_failed_registrations().filter(id=stuck_reg.id).exists():
            stuck_reg.delete_registration_tree(save=True)
            messages.success(request, 'The registration has been deleted')
        else:
            messages.error(request, 'This registration may not technically be stuck,'
                                    ' if the problem persists get a developer to fix it.')

        return redirect(reverse_node(self.kwargs.get('guid')))
Beispiel #2
0
    def post(self, request, *args, **kwargs):
        stuck_reg = self.get_object()
        if Registration.find_failed_registrations().filter(id=stuck_reg.id).exists():
            stuck_reg.delete_registration_tree(save=True)
            messages.success(request, 'The registration has been deleted')
        else:
            messages.error(request, 'This registration may not technically be stuck,'
                                    ' if the problem persists get a developer to fix it.')

        return redirect(reverse_node(self.kwargs.get('guid')))
Beispiel #3
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     node = Node.load(self.kwargs.get('guid')) or Registration.load(
         self.kwargs.get('guid'))
     context['id'] = node._id
     context['public_cap'] = round(
         node.custom_storage_usage_limit_public or STORAGE_LIMIT_PUBLIC, 1)
     context['private_cap'] = round(
         node.custom_storage_usage_limit_private or STORAGE_LIMIT_PRIVATE,
         1)
     return context
Beispiel #4
0
    def post(self, request, *args, **kwargs):
        node = Node.load(self.kwargs.get('guid')) or Registration.load(
            self.kwargs.get('guid'))
        new_private_cap = request.POST.get('private-cap-input')
        new_public_cap = request.POST.get('public-cap-input')
        if float(new_private_cap) != (node.custom_storage_usage_limit_private
                                      or STORAGE_LIMIT_PRIVATE):
            node.custom_storage_usage_limit_private = new_private_cap

        if float(new_public_cap) != (node.custom_storage_usage_limit_public
                                     or STORAGE_LIMIT_PUBLIC):
            node.custom_storage_usage_limit_public = new_public_cap

        node.save()
        return redirect(reverse_node(self.kwargs.get('guid')))
Beispiel #5
0
 def get_object(self, queryset=None):
     return Registration.load(self.kwargs.get('guid'))
Beispiel #6
0
 def get_queryset(self):
     return Registration.find_failed_registrations().order_by(self.ordering)
Beispiel #7
0
 def get_object(self, queryset=None):
     guid = self.kwargs.get('guid')
     node = Node.load(guid) or Registration.load(guid)
     return serialize_node(node)
Beispiel #8
0
 def get_object(self, queryset=None):
     return Node.load(self.kwargs.get('guid')) or Registration.load(self.kwargs.get('guid'))
Beispiel #9
0
 def get_object(self, queryset=None):
     guid = self.kwargs.get('guid')
     node = Node.load(guid) or Registration.load(guid)
     return serialize_node(node)
Beispiel #10
0
 def get_queryset(self):
     return Registration.find_failed_registrations().order_by(self.ordering)