Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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. #289

Open
vjpixel opened this issue Jan 29, 2020 · 2 comments
Labels
artist bug Something isn't working CMS enhancement New feature or request
Milestone

Comments

@vjpixel
Copy link
Member

vjpixel commented Jan 29, 2020

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

@vjpixel vjpixel added enhancement New feature or request CMS artist labels Jan 29, 2020
@vjpixel vjpixel added this to the Launch milestone Jan 29, 2020
@vjpixel vjpixel changed the title As an artist, I want to reveive a warning when I try to upload the wrong file format, so I can publish the right one. 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. Jan 30, 2020
@vjpixel vjpixel added the bug Something isn't working label Feb 10, 2020
@marcos-mv
Copy link
Contributor

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

@vjpixel
Copy link
Member Author

vjpixel commented May 7, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artist bug Something isn't working CMS enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants