{{{
"use strict";
(function () {
// Automatically check "Uploaded avatar" radio button if user selects an
avatar.
Array.prototype.forEach.call(document.querySelectorAll('.avatar-image-
upload'), function (el) {
var form = el.closest('form');
var radioButton =
form.querySelector('input[type=radio][name=avatar_from][value=upload]');
el.addEventListener('change', function () {
if (el.value === '') return;
radioButton.checked = true;
});
});
})();
//# sourceMappingURL=../../../../maps/spongeauth/static/scripts/app.js.map
}}}
This file worked well with Django 3 but now it ends up in a KeyError:
{{{
app_1 | + /home/spongeauth/env/bin/python spongeauth/manage.py
collectstatic --noinput
app_1 | Traceback (most recent call last):
app_1 | File "/home/spongeauth/app/spongeauth/manage.py", line 28, in
<module>
app_1 | execute_from_command_line(sys.argv)
app_1 | File "/home/spongeauth/env/lib/python3.10/site-
packages/django/core/management/__init__.py", line 425, in
execute_from_command_line
app_1 | utility.execute()
app_1 | File "/home/spongeauth/env/lib/python3.10/site-
packages/django/core/management/__init__.py", line 419, in execute
app_1 | self.fetch_command(subcommand).run_from_argv(self.argv)
app_1 | File "/home/spongeauth/env/lib/python3.10/site-
packages/django/core/management/base.py", line 373, in run_from_argv
app_1 | self.execute(*args, **cmd_options)
app_1 | File "/home/spongeauth/env/lib/python3.10/site-
packages/django/core/management/base.py", line 417, in execute
app_1 | output = self.handle(*args, **options)
app_1 | File "/home/spongeauth/env/lib/python3.10/site-
packages/django/contrib/staticfiles/management/commands/collectstatic.py",
line 187, in handle
app_1 | collected = self.collect()
app_1 | File "/home/spongeauth/env/lib/python3.10/site-
packages/django/contrib/staticfiles/management/commands/collectstatic.py",
line 128, in collect
app_1 | for original_path, processed_path, processed in processor:
app_1 | File "/home/spongeauth/env/lib/python3.10/site-
packages/django/contrib/staticfiles/storage.py", line 426, in post_process
app_1 | yield from super().post_process(*args, **kwargs)
app_1 | File "/home/spongeauth/env/lib/python3.10/site-
packages/django/contrib/staticfiles/storage.py", line 247, in post_process
app_1 | for name, hashed_name, processed, _ in
self._post_process(paths, adjustable_paths, hashed_files):
app_1 | File "/home/spongeauth/env/lib/python3.10/site-
packages/django/contrib/staticfiles/storage.py", line 312, in
_post_process
app_1 | content = pattern.sub(converter, content)
app_1 | File "/home/spongeauth/env/lib/python3.10/site-
packages/django/contrib/staticfiles/storage.py", line 173, in converter
app_1 | matched = matches['matched']
app_1 | KeyError: 'matched'
}}}
I can't find a note on the migration docs that sourceFileMappingURLs need
to be changed, so I suspect this being a bug.
Source: https://github.com/SpongePowered/SpongeAuth/pull/926
--
Ticket URL: <https://code.djangoproject.com/ticket/33494>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
New description:
{{{
"use strict";
//# sourceMappingURL=../../../../maps/spongeauth/static/scripts/app.js.map
}}}
I think this RegEx is the problem:
https://github.com/django/django/blob/main/django/contrib/staticfiles/storage.py#L61.
The "matched" group matches nothing. It should be something like
{{{
(?m)(?P<matched>[\s\S]*)^(//# (?-i:sourceMappingURL)=(?P<url>.*))$
}}}
maybe. I also do not see any sourceMappingURL support for css. Has it been
removed?
Source: https://github.com/SpongePowered/SpongeAuth/pull/926
--
--
Ticket URL: <https://code.djangoproject.com/ticket/33494#comment:1>
Old description:
> I've tried updating a django app to 4.0. We are building our scripts with
> I think this RegEx is the problem:
> https://github.com/django/django/blob/main/django/contrib/staticfiles/storage.py#L61.
> The "matched" group matches nothing. It should be something like
> {{{
> (?m)(?P<matched>[\s\S]*)^(//# (?-i:sourceMappingURL)=(?P<url>.*))$
> }}}
> maybe. I also do not see any sourceMappingURL support for css. Has it
> been removed?
>
> Source: https://github.com/SpongePowered/SpongeAuth/pull/926
New description:
{{{
"use strict";
//# sourceMappingURL=../../../../maps/spongeauth/static/scripts/app.js.map
}}}
I think this RegEx is the problem:
https://github.com/django/django/blob/main/django/contrib/staticfiles/storage.py#L61.
The "matched" group matches nothing.
I also do not see any sourceMappingURL support for css. Has it been
removed or was it never a feature?
Source: https://github.com/SpongePowered/SpongeAuth/pull/926
--
--
Ticket URL: <https://code.djangoproject.com/ticket/33494#comment:2>
* status: new => closed
* resolution: => invalid
Comment:
My bad. We are overriding some code.
--
Ticket URL: <https://code.djangoproject.com/ticket/33494#comment:3>