Jandig icon indicating copy to clipboard operation
Jandig copied to clipboard

As an artist, I want to receive a warning when I try to upload the wrong file format, so I can publish the right one.

Open vjpixel opened this issue 6 years ago • 2 comments

The system does not verify the file format now, and that can lead to errors from artists.

vjpixel avatar Jan 29 '20 18:01 vjpixel

I tried to recreate this problem but apparently it is already solved. Only the allowed formats appear for the user to choose.

marcos-mv avatar May 05 '21 23:05 marcos-mv

I've just uploaded a PDF as an Object, and it led to the following error. I fixed it in the Django Admin, but the system still allows people to upload a wrong file format and it can break the system until the file is deleted by an admin.

To reproduce it:

  1. Go to My Stuff
  2. Then to Upload Object
  3. When the Open File dialogue opens, click in Customized Files and change it to All Files
  4. Upload a not supported file (like a PDF)

Be aware that this will break the system, so do this with someone with admin access "near" you. =)

+++

Environment:

Request Method: GET Request URL: http://jandig.app/users/profile/

Django Version: 2.2.10 Python Version: 3.7.3 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'debug_toolbar', 'corsheaders', 'users', 'core', 'docs'] Installed Middleware: ['debug_toolbar.middleware.DebugToolbarMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:

File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request)

File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/base.py" in _get_response 115. response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/base.py" in _get_response 113. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.7/dist-packages/django/contrib/auth/decorators.py" in _wrapped_view 21. return view_func(request, *args, **kwargs)

File "/ARte/src/ARte/users/views.py" in profile 160. return render(request, 'users/profile.jinja2', ctx)

File "/usr/local/lib/python3.7/dist-packages/django/shortcuts.py" in render 36. content = loader.render_to_string(template_name, context, request, using=using)

File "/usr/local/lib/python3.7/dist-packages/django/template/loader.py" in render_to_string 62. return template.render(context, request)

File "/usr/local/lib/python3.7/dist-packages/django/template/backends/jinja2.py" in render 71. return self.template.render(context)

File "/usr/local/lib/python3.7/dist-packages/jinja2/environment.py" in render 1090. self.environment.handle_exception()

File "/usr/local/lib/python3.7/dist-packages/jinja2/environment.py" in handle_exception 832. reraise(*rewrite_traceback_stack(source=source))

File "/usr/local/lib/python3.7/dist-packages/jinja2/_compat.py" in reraise 28. raise value.with_traceback(tb)

File "/ARte/src/ARte/users/jinja2/users/profile.jinja2" in top-level template code

  1. {% extends '/core/home.jinja2' %}

File "/ARte/src/ARte/core/jinja2/core/home.jinja2" in top-level template code 46. {% block content %}

File "/ARte/src/ARte/users/jinja2/users/profile.jinja2" in block "content" 52. {% include "users/components/item-list.jinja2" %}

File "/ARte/src/ARte/users/jinja2/users/components/item-list.jinja2" in top-level template code 19.

File "/usr/local/lib/python3.7/dist-packages/jinja2/environment.py" in getattr 471. return getattr(obj, attribute)

File "/ARte/src/ARte/users/models.py" in yproportion 123. height = float(a[1])

Exception Type: IndexError at /users/profile/ Exception Value: list index out of range

vjpixel avatar May 07 '21 19:05 vjpixel