Project

General

Profile

Segnalazione #287

Massedit di utenti: eccezione non gestita in caso di assenza di quote

Added by Christopher R. Gabriel over 4 years ago. Updated over 4 years ago.

Status:
Chiuso
Priority:
Alta
Start date:
06/07/2017
Due date:
% Done:

0%


Description

Nella modifica di massa degli utenti, se la quota non e' attiva si ottiene una eccezione:

Environment:

Request Method: GET
Request URL: http://octofuss.einaudi.blz/users/massedit?uids=admin,pippo

Django Version: 1.8.16
Python Version: 3.4.2
Installed Applications:
['django.contrib.sessions',
 'django.contrib.messages',
 'whitenoise.runserver_nostatic',
 'django.contrib.staticfiles',
 'octonet',
 'hostqueue.apps.HostQueue',
 'firewall.apps.Firewall',
 'dhcp.apps.Dhcp',
 'dansguardian.apps.DansGuardian',
 'host.apps.Host',
 'polygen.apps.Polygen',
 'upgrade.apps.Upgrade',
 'asterisk.apps.Asterisk',
 'samba.apps.Samba',
 'users.apps.Users',
 'script.apps.Script',
 'quota.apps.Quota',
 'printers.apps.Printers',
 'auth.apps.Auth']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'whitenoise.middleware.WhiteNoiseMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'octonet.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3/dist-packages/django/views/generic/base.py" in view
  71.             return self.dispatch(request, *args, **kwargs)
File "/usr/share/octonet/users/views.py" in dispatch
  127.         return super().dispatch(request, *args, **kwargs)
File "/usr/share/octonet/octonet/mixins.py" in dispatch
  114.         return super().dispatch(request, *args, **kw)
File "/usr/lib/python3/dist-packages/django/views/generic/base.py" in dispatch
  89.         return handler(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/django/views/generic/edit.py" in get
  205.         form = self.get_form()
File "/usr/lib/python3/dist-packages/django/views/generic/edit.py" in get_form
  74.         return form_class(**self.get_form_kwargs())
File "/usr/lib/python3/dist-packages/django/views/generic/edit.py" in get_form_kwargs
  81.             'initial': self.get_initial(),
File "/usr/share/octonet/users/views.py" in get_initial
  131.             "quota": [{"fs": fs} for fs in self.root_tree.llist(["quota"])]
File "/usr/lib/python3/dist-packages/octofuss/xmlrpc.py" in llist
  106.         return self._wrap_call(self.server.list, "/".join(path))
File "/usr/lib/python3/dist-packages/octofuss/xmlrpc.py" in _wrap_call
  78.             raise exception_serializer.from_dict(res["exc"])

Exception Type: KeyError at /users/massedit
Exception Value: "'path /quota does not exist'" 

Associated revisions

Revision 968d6d62 (diff)
Added by Mark Caglienzi over 4 years ago

Cache the has_quota parameter in load_objects(). refs: #287

Revision b1afbc35 (diff)
Added by Mark Caglienzi over 4 years ago

Make use of self.has_quota in the backend. refs: #287

Revision f7be1f69 (diff)
Added by Mark Caglienzi over 4 years ago

Pass self.has_quota to the template. refs: #287

Revision 44c789a9 (diff)
Added by Mark Caglienzi over 4 years ago

Make use of self.has_quota in the frontend. refs: #287

History

#1 Updated by Mark Caglienzi over 4 years ago

  • Status changed from Nuovo to In elaborazione

#2 Updated by Mark Caglienzi over 4 years ago

  • Status changed from In elaborazione to Commenti
  • Assignee changed from Mark Caglienzi to Christopher R. Gabriel
e3a63085:
  • Flag bool self.has_quota in load_objects()
  • Questo viene passato nel template (per caricare o meno la parte di quote e modificare il titolo della sottosezione) e usato in get_form_class(), get_initial() e form_valid() per caricare o meno la parte di quote nel multiform
  • Ho fatto diversi test con e senza quote, e mi sembra funzionare

Ti sembra ok?

Mergiato in master e pushato

#3 Updated by Christopher R. Gabriel over 4 years ago

  • Status changed from Commenti to Chiuso

Verificato, ok.

Also available in: Atom PDF