Media gallery: allows duplicate titles but errors

VERIFIED FIXED in 2.3

Status

VERIFIED FIXED
8 years ago
8 years ago

People

(Reporter: rbillings, Assigned: rrosario)

Tracking

unspecified
x86
macOS

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
If a user uploads two images with identical filenames the media gallery should return a duplicate error. Instead a 404 page with 'An Error Occurred' displays.

1) /media> upload> add file '12345' title and desc > submit
2) upload link > add any file> give it title '12345' and description > submit

expected: duplicate filename error
actual: Error
error:
IntegrityError: (1062, "Duplicate entry 'en-US-12345' for key 2")


<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {u'locale': [u'en-US'], u'csrfmiddlewaretoken': [u'644f199633dc5ca857cf1e5c40a9112b'], u'upload': [u'Submit file'], u'description': [u'12345'], u'title': [u'12345']}>,
COOKIES:{'SSID': 'AwCgfikAAAQA3fTJTCsTFwHd9MlMAgAAAAAAAAAAAAAAAACdpdFMAAAM_v__AAAAAABCAAAA',
 'SSID_SUMO': 'AwA6jCkAAAAApyHPTJc3BAKnIc9MBgAsnNBMAAAAAFgq-EzhE9tMAwAxAAAAwAAAAAM',
 'SSLB_SUMO': '1',
 'SSRT': '4RPbTAE',
 'SUMOloggedin': 'true',
 'SUMOv1': '8955r6tvoa15dv3mvm2o8mi5e4',
 'WT_FPC': 'id=24.4.140.103-787580352.30110063:lv=1289866287514:ss=1289862164930',
 'csrftoken': '644f199633dc5ca857cf1e5c40a9112b',
 'multidb_pin_writes': 'y',
 'sessionid': 'c67436aa64293267b83c9b84362b2546',
 'wtspl': '743545'},
META:{'CONTENT_LENGTH': '114',
 'CONTENT_TYPE': 'application/x-www-form-urlencoded',
 'CSRF_COOKIE': '644f199633dc5ca857cf1e5c40a9112b',
 'DOCUMENT_ROOT': '/data/www/master.support.mozilla.com/webroot',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTPS': 'on',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
 'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8,fr-FR;q=0.6,fr;q=0.4,en;q=0.2',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': 'WT_FPC=id=24.4.140.103-787580352.30110063:lv=1289866287514:ss=1289862164930; wtspl=743545; csrftoken=644f199633dc5ca857cf1e5c40a9112b; SSID=AwCgfikAAAQA3fTJTCsTFwHd9MlMAgAAAAAAAAAAAAAAAACdpdFMAAAM_v__AAAAAABCAAAA; SSRT=naXRTAA; SSLB_SUMO=1; SSID_SUMO=AwA6jCkAAAAApyHPTJc3BAKnIc9MBgAsnNBMAAAAAFgq-EzhE9tMAwAxAAAAwAAAAAM; SSRT=4RPbTAE; SUMOv1=8955r6tvoa15dv3mvm2o8mi5e4; SUMOloggedin=true; sessionid=c67436aa64293267b83c9b84362b2546; multidb_pin_writes=y',
 'HTTP_HOST': 'master.support.mozilla.com',
 'HTTP_KEEP_ALIVE': '115',
 'HTTP_REFERER': 'https://master.support.mozilla.com/en-US/gallery/images',
 'HTTP_SSLCLIENTCERTSTATUS': 'NoClientCert',
 'HTTP_SSLCLIENTCIPHER': 'SSL_RSA_WITH_RC4_128_SHA, version=TLSv1, bits=128',
 'HTTP_SSLSESSIONID': '3A17E7AD99FD961F1037B7C9AC5B67700ED017528F9B0CA99BDF2E54EE50E6C4',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12',
 'HTTP_X_CLUSTER_CLIENT_IP': '24.4.140.103',
 'HTTP_X_FORWARDED_FOR': '24.4.140.103',
 'PATH_INFO': u'/en-US/gallery/images/upload',
 'PATH_TRANSLATED': 'redirect:/k/en-US/gallery/images/upload/gallery/images/upload',
 'QUERY_STRING': '',
 'REDIRECT_HTTPS': 'on',
 'REDIRECT_SCRIPT_URI': 'https://master.support.mozilla.com/en-US/gallery/images/upload',
 'REDIRECT_SCRIPT_URL': '/en-US/gallery/images/upload',
 'REDIRECT_STATUS': '200',
 'REDIRECT_URL': '/en-US/gallery/images/upload',
 'REMOTE_ADDR': '10.2.10.101',
 'REMOTE_PORT': '35838',
 'REQUEST_METHOD': 'POST',
 'REQUEST_URI': '/en-US/gallery/images/upload',
 'SCRIPT_FILENAME': '/data/www/master.support.mozilla.com/kitsune/wsgi/kitsune.wsgi',
 'SCRIPT_NAME': u'',
 'SCRIPT_URI': 'https://master.support.mozilla.com/en-US/gallery/images/upload',
 'SCRIPT_URL': '/en-US/gallery/images/upload',
 'SERVER_ADDR': '10.2.74.53',
 'SERVER_ADMIN': 'root@localhost',
 'SERVER_NAME': 'master.support.mozilla.com',
 'SERVER_PORT': '443',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SIGNATURE': '<address>Apache/2.2.3 (Red Hat) Server at master.support.mozilla.com Port 443</address>\n',
 'SERVER_SOFTWARE': 'Apache/2.2.3 (Red Hat)',
 'mod_wsgi.application_group': 'master.support.mozilla.com|/k',
 'mod_wsgi.callable_object': 'application',
 'mod_wsgi.handler_script': '',
 'mod_wsgi.input_chunked': '0',
 'mod_wsgi.listener_host': '',
 'mod_wsgi.listener_port': '81',
 'mod_wsgi.process_group': 'kitsune-ssl',
 'mod_wsgi.request_handler': 'wsgi-script',
 'mod_wsgi.script_reloading': '1',
 'mod_wsgi.version': (3, 2),
 'platform.name': 'dm-app-sumo01.mozilla.org',
 'wsgi.errors': <mod_wsgi.Log object at 0x2aaab17667f0>,
 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x2aaab167a8a0>,
 'wsgi.input': <mod_wsgi.Input object at 0x2aaab1766b70>,
 'wsgi.loaded': datetime.datetime(2010, 11, 15, 16, 4, 46, 657209),
 'wsgi.multiprocess': True,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'https',
 'wsgi.version': (1, 1)}>
We have no problem with duplicate file names, we need to handle duplicate titles better, though. Why isn't form validation picking this up?
Summary: Media gallery: allows duplicate file uploads but errors → Media gallery: allows duplicate titles but errors
(Assignee)

Updated

8 years ago
Assignee: nobody → rrosario
(Reporter)

Comment 3

8 years ago
Verified error displays if adding a file with a duplicate title
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.