id
stringlengths
32
49
content
stringlengths
777
333k
swe-bench_data_astropy__astropy-7166
InheritDocstrings metaclass doesn't work for properties Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties. diff --git a/astropy/utils/misc.py b/astropy/utils/misc.py --- a/astropy/utils/misc.py +++ b/astropy/utils/misc.py @@ -4,9 +4,6 @@ A "grab bag" of relative...
swe-bench_data_astropy__astropy-7218
HDUList.copy() returns a list Currently ``HDUList.copy()`` returns a list rather than an ``HDUList``: ```python In [1]: from astropy.io.fits import HDUList In [2]: hdulist = HDUList() In [3]: hdulist.copy() Out[3]: [] In [4]: type(_) Out[4]: list ``` This is with Python 3.6. diff --git a/astropy/io...
swe-bench_data_astropy__astropy-7336
units.quantity_input decorator fails for constructors with type hinted return value -> None ### Summary I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `...
swe-bench_data_astropy__astropy-7441
astropy.time.TimeDelta should support conversion to `datetime.timedelta` Because of the inheritance `TimeDelta` has a method `to_datetime` which is useless. It should have a method `to_timedelta` which returns a `datetime.timedelta` object or objects. Conversion to `np.datetime64` (for `Time`) and `np.timedelta64` (f...
swe-bench_data_astropy__astropy-7606
Unit equality comparison with None raises TypeError for UnrecognizedUnit ``` In [12]: x = u.Unit('asdf', parse_strict='silent') In [13]: x == None # Should be False --------------------------------------------------------------------------- TypeError Traceback (most recent call la...
swe-bench_data_astropy__astropy-7671
minversion failures The change in PR #7647 causes `minversion` to fail in certain cases, e.g.: ``` >>> from astropy.utils import minversion >>> minversion('numpy', '1.14dev') TypeError Traceback (most recent call last) <ipython-input-1-760e6b1c375e> in <module>() 1 from astro...
swe-bench_data_astropy__astropy-7737
biweight_location of a constant array returns nan Currently the robust mean estimator `biweight_location` returns `nan` for an array with zero variance. eg: ``` >>> astropy.stats.biweight_location(np.ones(4)) nan # Instead of expected value 1 ``` This is primarily because of a 0/0 division in the code (case w...
swe-bench_data_astropy__astropy-7746
Issue when passing empty lists/arrays to WCS transformations The following should not fail but instead should return empty lists/arrays: ``` In [1]: from astropy.wcs import WCS In [2]: wcs = WCS('2MASS_h.fits') In [3]: wcs.wcs_pix2world([], [], 0) -------------------------------------------------------------...
swe-bench_data_astropy__astropy-7858
Issue when transforming a single scalar coordinate with a 1D WCS The following example illustrates a bug when dealing with single scalar coordinates in 1D WCSes: ``` In [1]: from astropy.wcs import WCS In [2]: wcs = WCS(naxis=1) In [3]: wcs.all_pix2world(29, 0) -----------------------------------------------...
swe-bench_data_astropy__astropy-7973
Record data size in the WCS object It is clear that there are practical reasons to have a record of the original data size in the WCS object. This in the past has been recorded in public attributes `naxis1` and `naxis2` and subsequently in the private `_naxis1` and `_naxis2`. There's along thread on why this should ...
swe-bench_data_astropy__astropy-8005
Cosmologies used in equivalencies The thermodynamic temperature equivalency appears to default to the Planck 2015 cosmology value: ```python if T_cmb is None: from ..cosmology import Planck15 T_cmb = Planck15.Tcmb0 ``` whereas in the ``with_H0`` equivalency added in https://github.com/astr...
swe-bench_data_astropy__astropy-8251
FITS-standard unit parsing fails on some types of exponents Why don't these work: ```python from astropy.units import Unit Unit('10**17 erg/(cm2 s Angstrom)', format='fits') Unit('10^17 erg/(cm2 s Angstrom)', format='fits') ``` When these all do: ```python from astropy.units import Unit Unit('10+17 erg/(cm2 s ...
swe-bench_data_astropy__astropy-8263
units: 's / m' and 's / m' are not convertible To paraphrase from https://github.com/PlasmaPy/PlasmaPy/issues/587, exceptions like `astropy.units.core.UnitConversionError: 's / m' and 's / m' are not convertible` (and a few other cases with first, second and third powers of second over meter, curiously) started popping...
swe-bench_data_astropy__astropy-8292
Problem with the `littleh` part of unit equivalencies? In the newly added `littleh` equivalencies: http://docs.astropy.org/en/stable/units/equivalencies.html#unit-equivalencies We notice that the implementation of `littleh` seems to be wrong, as highlighted in the following figure: ![screen shot 2018-12-12 at 12...
swe-bench_data_astropy__astropy-8339
ncp_prior referenced before assignment in Bayesian Blocks There is a bug in the bayesian blocks algorithm of astropy.stats. It's not a big deal so I show you below how to solve it directly. When I call: ```python bayesian_blocks(tt, ff, sig, fitness='measures', ncp_prior=ncpp) ``` I get: ``` Traceback (most ...
swe-bench_data_astropy__astropy-8519
Adding/subtracting ABmag Quantities loses the "type" of magnitude The following code raises a `UnitConversionError`, because it appears the math operation lost track of the "type" of magnitude. `fluxMag` and `color` are both `ABmag`, so I would expect their difference to also be an ABmag. ```python import numpy as ...
swe-bench_data_astropy__astropy-8707
Header.fromstring does not accept Python 3 bytes According to [the docs](http://docs.astropy.org/en/stable/_modules/astropy/io/fits/header.html#Header.fromstring), the method `Header.fromstring` "...creates an HDU header from a byte string containing the entire header data." By "byte string" here it really means the...
swe-bench_data_astropy__astropy-8715
Silence warnings by default when reading in VO Tables ### TL;DR Users often are given files they don't have control over, and those files aren't always standard-compliant. This is especially true of VO Tables. I'd like to suggest that we make the VO Table reader more forgiving, although the *writer* should continue ...
swe-bench_data_astropy__astropy-8747
Support new clip ufunc Starting with numpy 1.17, `np.clip` will be based on a `ufunc`, which means we can ensure it works properly with `Quantity`. (Until we do so, we might also get `numpy-dev` failures.) diff --git a/astropy/units/function/core.py b/astropy/units/function/core.py --- a/astropy/units/function/core.p...
swe-bench_data_astropy__astropy-8872
float16 quantities get upgraded to float64 automatically When trying to create a `Quantity` from a `np.float16` (not something I actually intended to do, I was experimenting while investigating other issue) it gets upgraded automatically to `np.float64`, which is something that does not happen with other float types: ...
swe-bench_data_django__django-10087
Misleading sqlmigrate "App 'apps.somethings' does not have migrations." error message Description This ticket is very similar to https://code.djangoproject.com/ticket/29506 As shown above, validation should be added sqlmigrate. diff --git a/django/core/management/commands/sqlmigrate.py b/django/core/management/comm...
swe-bench_data_django__django-10097
Make URLValidator reject invalid characters in the username and password Description (last modified by Tim Bell) Since #20003, core.validators.URLValidator accepts URLs with usernames and passwords. RFC 1738 section 3.1 requires "Within the user and password field, any ":", "@", or "/" must be encoded"; however...
swe-bench_data_django__django-10213
Add an option to django-admin to always colorize output Description With Django management commands, it is currently possible disable colors with the --no-colors flag. What I'd like to have is basically the other side of the coin: a --force-colors flag that instructs Django to output ANSI color sequences in cases it ...
swe-bench_data_django__django-10287
Add validation of related fields and lookups in model Meta.ordering Description When the ordering class member in Meta of a model contains a field from a related model, and that field does not exist, django's makemigrations does not throw an error. However, if it is a direct field member of the same class, makemigrat...
swe-bench_data_django__django-10301
SQLite functions crashes on NULL values Description In [14]: TestModel2.objects.annotate(null=models.Value(None, output_field=models.IntegerField())).values(pow=models.F('null') ** models.F('null')).first() --------------------------------------------------------------------------- OperationalError Traceback (m...
swe-bench_data_django__django-10316
diffsettings raises misleading exception message if using settings.configure() Description If, rather than using the env var DJANGO_SETTINGS_MODULE one uses settings.configure(...), attempting to call diffsettings can fail because it calls settings._setup() unconditionally, with the exception django.core.exceptions.I...
swe-bench_data_django__django-10390
Trunc() should allow passing is_dst resolution to avoid NonExistentTimeError/AmbiguousTimeError Description (last modified by Alexander Holmbäck) When Trunc() truncates to a nonexisting or ambiguous datetime, the exception raised by pytz remains unhandled. The expected behavior would, IMO, be to not check the v...
swe-bench_data_django__django-10426
Add app_label validation to showmigrations Description #29469 #29518 #29506 The app label validation was added to some commands as above tickets. But showmigrations command doesn't contain it. So I think the validation should be added to showmigrations command. diff --git a/django/core/management/commands/showmigra...
swe-bench_data_django__django-10531
Models history doesn't use verbose names Description The history for a model object (within the admin section) should show human-readable messages, favoring verbose names over field names. However, this is not currently the case. For example, consider a model with the following class variable: pub_date = models.DateT...
swe-bench_data_django__django-10554
Union queryset with ordering breaks on ordering with derived querysets Description (last modified by Sergei Maertens) May be related to #29692 Simple reproduction (the exact models are not relevant I think): >>> Dimension.objects.values_list('id', flat=True) <QuerySet [10, 11, 12, 13, 14, 15, 16, 17, 18]> >>> q...
swe-bench_data_django__django-10606
Using RelatedOnlyFieldListFilter with reverse ManyToMany crashes Description (last modified by Tim Graham) Using RelatedOnlyFieldListFilter with a reverse ManyToMany relation causes this exception: get_choices() got an unexpected keyword argument 'limit_choices_to' This method in ForeignObjectRel.get_choices is...
swe-bench_data_django__django-10643
Allow icontains lookup to accept uuids with or without dashes Description We have Django 2.1 project with model admin which includes an UUIDField in list_display and search_fields. The UUID is displayed with dashes on changelist (e.g. "245ba2eb-6852-47be-82be-7dc07327cf9e") and if the user cut'n'paste it to the searc...
swe-bench_data_django__django-10680
Refactor AutoField logic into a mixin, implement checks and validators. Description Currently AutoField inherits from Field and BigAutoField from AutoField. In effect they largely redefine IntegerField and BigIntegerField respectively, but add in the auto field "behaviour". As a result they do not perform some of the...
swe-bench_data_django__django-10730
Infinite loop in ExceptionReporter.get_traceback_frames() Description The following code generates a cause/context cycle (exc_value.__cause__.__context__ is exc_value): except WrapperException as exc: raise exc.__cause__ The ​while exc_value loop then never terminates. diff --git a/django/views/debug.py b/django/v...
swe-bench_data_django__django-10737
Raised FieldError's should include the field that caused the error Description Currently there are many places in ​django/db/models/sql/compiler.py that raise a FieldError however frustratingly the field that caused the error is not included. I'm proposing that, where possible, all raised FieldError's raised should i...
swe-bench_data_django__django-10853
SQLite (pre 3.25.0) does not support window functions, raises OperationalError Description Window functions are supported in SQLite 3.25.0 and newer, but Python 3.6.7 and 3.7.1 only ships with SQLite 3.21.0. Window function syntax is invalid for older versions. As per the title, window functions therefore aren't supp...
swe-bench_data_django__django-10880
Query syntax error with condition and distinct combination Description A Count annotation containing both a Case condition and a distinct=True param produces a query error on Django 2.2 (whatever the db backend). A space is missing at least (... COUNT(DISTINCTCASE WHEN ...). diff --git a/django/db/models/aggregates...
swe-bench_data_django__django-10904
Replace use of OSError aliases with OSError (IOError, EnvironmentError, WindowsError, mmap.error, socket.error, select.error) Description Starting with Python 3.3, EnvironmentError, IOError, WindowsError, socket.error, select.error and mmap.error are aliases of OSError. With this in mind, the Django code base can be ...
swe-bench_data_django__django-10910
Using database functions with tzinfo=datetime.timezone(datetime.timedelta(...)) results in an incorrect query Description I haven’t checked this bug with other databases, but it definitely works improperly with postgres. Django ORM create incorrect query when I use timezone determined like "timezone(timedelta(hours=s...
swe-bench_data_django__django-10914
Set default FILE_UPLOAD_PERMISSION to 0o644. Description Hello, As far as I can see, the ​File Uploads documentation page does not mention any permission issues. What I would like to see is a warning that in absence of explicitly configured FILE_UPLOAD_PERMISSIONS, the permissions for a file uploaded to FileSystemSto...
swe-bench_data_django__django-10924
Allow FilePathField path to accept a callable. Description I have a special case where I want to create a model containing the path to some local files on the server/dev machine. Seeing as the place where these files are stored is different on different machines I have the following: import os from django.conf import...
swe-bench_data_django__django-10939
ModelAdmin with custom widgets, inlines, and filter_horizontal can merge media in broken order Description when a modeadmin have a inline with a filed has its own media js no need jquery , and have a one to many field show filter_horizontal, the problem appear. there will be MediaOrderConflictWarning and inlines.js l...
swe-bench_data_django__django-10957
Deprecate ugettext(), ugettext_lazy(), ugettext_noop(), ungettext(), and ungettext_lazy() Description Along the lines of #27753 (Cleanups when no supported version of Django supports Python 2 anymore), the legacy functions in django.utils.translation -- ugettext(), ugettext_lazy(), ugettext_noop(), ungettext(), and u...
swe-bench_data_django__django-10973
Use subprocess.run and PGPASSWORD for client in postgres backend Description ​subprocess.run was added in python 3.5 (which is the minimum version since Django 2.1). This function allows you to pass a custom environment for the subprocess. Using this in django.db.backends.postgres.client to set PGPASSWORD simplifies ...
swe-bench_data_django__django-10989
Ellipses in output strings cause crashes on Windows Description (last modified by Dan Davis) By default, Windows terminals start with code page 437, which is roughly equivalent to ASCII. While working on #30178, I discovered that this causes the following traceback: (mplusmon) λ manage.py runserver Watchman una...
swe-bench_data_django__django-10997
Show applied datetime in showmigrations Description (last modified by Timothy Schilling) My idea is to add the applied datetime value to the showmigrations command. I've run into the case where I'm working on a branch that involves a number of migrations across various apps, but then have to switch to a differe...
swe-bench_data_django__django-10999
Fix parse_duration() for some negative durations Description The ​https://docs.djangoproject.com/en/2.1/_modules/django/utils/dateparse/ defines: standard_duration_re = re.compile( r'^' r'(?:(?P<days>-?\d+) (days?, )?)?' r'((?:(?P<hours>-?\d+):)(?=\d+:\d+))?' r'(?:(?P<minutes>-?\d+):)?' r'(?P<seconds>-?\d+)' r'...
swe-bench_data_django__django-11001
Incorrect removal of order_by clause created as multiline RawSQL Description Hi. The SQLCompiler is ripping off one of my "order by" clause, because he "thinks" the clause was already "seen" (in SQLCompiler.get_order_by()). I'm using expressions written as multiline RawSQLs, which are similar but not the same. The b...
swe-bench_data_django__django-11003
Initialising disabled ModelChoiceField yields 'Select a valid choice'-error despite initialised option being valid Description (last modified by Mariusz Felisiak) I have a form with a ModelChoiceField that gets initialised to a specific value using get_initial in that form's View. This value is a valid choice f...
swe-bench_data_django__django-11011
Make FileResponse always set Content-Disposition header. Description (last modified by Piotr Kunicki) FileResponse currently sets the Content-Disposition header only if as_attachment is true. Setting it explicitly to, e.g. 'inline; filename="example.png"' in the other case would allow the browser to set a defau...
swe-bench_data_django__django-11019
Merging 3 or more media objects can throw unnecessary MediaOrderConflictWarnings Description Consider the following form definition, where text-editor-extras.js depends on text-editor.js but all other JS files are independent: from django import forms class ColorPicker(forms.Widget): class Media: js = ['color-pick...
swe-bench_data_django__django-11030
Subquery expressions unnecessarily added to group by Description Hi friends, My Django/SQL skills are not good enough to properly isolate the problem independently of my use case detailed below. I believe the problem is Subqueries being forced in to the group_by clause because they are select expressions. Per the bel...
swe-bench_data_django__django-11034
Disabled field in admin use hard coded label_suffix Description In the class helpers.AdminReadonlyField, the label_tag method has hard coded ":" It is nor configurable neither able to tranlate (in French we use a space before ":"). diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py --- a...
swe-bench_data_django__django-11039
sqlmigrate wraps it's outpout in BEGIN/COMMIT even if the database doesn't support transactional DDL Description (last modified by Simon Charette) The migration executor only adds the outer BEGIN/COMMIT ​if the migration is atomic and ​the schema editor can rollback DDL but the current sqlmigrate logic only tak...
swe-bench_data_django__django-11044
Make Form data/files initialize with an empty MultiValueDict rather than dict Description You might have a look here: ​https://github.com/django/django/blob/362813d6287925b8f63f/django/forms/forms.py#L78 None is converted to a regular dict but not to a QueryDict. Methods of the form might rely on the API of a QueryDi...
swe-bench_data_django__django-11049
Correct expected format in invalid DurationField error message Description If you enter a duration "14:00" into a duration field, it translates to "00:14:00" which is 14 minutes. The current error message for invalid DurationField says that this should be the format of durations: "[DD] [HH:[MM:]]ss[.uuuuuu]". But acc...
swe-bench_data_django__django-11053
Disallow non-uppercase settings in settings.configure() Description Contradictory to the documentation, settings.configure() and UserSettingsHolder.__getattr__() allow non-upper settings to be set and retrieved, respectively. This allows for the following to happen: import types from django.conf import settings setti...
swe-bench_data_django__django-11057
admin check for AuthenticationMiddleware should allow subclasses Description I am attempting an upgrade from 2.1 to 2.2b1. I have a custom middleware in place for authentication which essentially wraps around the base AuthenticationMiddleware and sets/unsets a cookie upon login and logout. This was working with Djang...
swe-bench_data_django__django-11062
Using an annotated field calculated with django.db.models.functions.Extract in aggregate results in ProgrammingError Description Aggregating most annotated fields works as expected, but if I put a DateTimeField through Extract during the annotate step, I get a ProgrammingError when trying to aggregate. models.py clas...
swe-bench_data_django__django-11066
RenameContentType._rename() doesn't save the content type on the correct database Description The commit in question: ​https://github.com/django/django/commit/f179113e6cbc8ba0a8d4e87e1d4410fb61d63e75 The specific lines in question: ​https://github.com/django/django/blob/586a9dc4295357de1f5ad0590ad34bf2bc008f79/django...
swe-bench_data_django__django-11070
Add autocomplete attribute to contrib.auth fields Description (last modified by CHI Cheng) Add autocomplete=username/email/current-password/new-password to contrib.auth builtin forms. Pull request: ​https://github.com/django/django/pull/9921 The most useful one is autocomplete=new-password, which prevents brows...
swe-bench_data_django__django-11085
Custom model metaclasses cannot access the attribute dict in __init__ Description In Django <=2.2, it is possible for models to define a custom metaclass (as a subclass of models.base.ModelBase) and access the attribute dict of the class being defined: from django.db import models class PageBase(models.base.ModelBase...
swe-bench_data_django__django-11087
Optimize .delete() to use only required fields. Description Hi! We're in the process of upgrading our Django 1.11 installation from Python 2.7 to Python 3.6, however are hitting an unexpected UnicodeDecodeError during a .delete() run by our daily data purging management command. STR: Have an existing Django 1.11 proj...
swe-bench_data_django__django-11088
default='' (non-bytestring) on BinaryField crashes some migration operations Description (last modified by James) Description Initial migration has a default value '' for BinaryField. Later, change default value to b'' and migrate. Trying to undo this migration fails. It seems like '' is allowed during migrati...
swe-bench_data_django__django-11095
add ModelAdmin.get_inlines() hook to allow set inlines based on the request or model instance. Description add ModelAdmin.get_inlines() hook to allow set inlines based on the request or model instance. Currently, We can override the method get_inline_instances to do such a thing, but a for loop should be copied to my...
swe-bench_data_django__django-11096
Support the use of admin_order_field on properties in the admin. Description The ModelAdmin class allows to specify properties from the model in list_display. Normally non-fields cannot be sorted. This can be changed by setting admin_order_field. This doesn't work on properties, while it is possible to do so with sho...
swe-bench_data_django__django-11099
UsernameValidator allows trailing newline in usernames Description ASCIIUsernameValidator and UnicodeUsernameValidator use the regex r'^[\w.@+-]+$' The intent is to only allow alphanumeric characters as well as ., @, +, and -. However, a little known quirk of Python regexes is that $ will also match a trailing newli...
swe-bench_data_django__django-11115
Make it easier to track down the offending models for AlreadyRegistered exceptions Description I've just updated 20+ packages locally in a project's requirements file, one of which has caused: [2016-10-18 15:00:18,667] ERROR [django.request:256] Internal Server Error: /browserid/csrf/ Traceback (most recent call last...
swe-bench_data_django__django-11119
Engine.render_to_string() should honor the autoescape attribute Description In Engine.render_to_string, a Context is created without specifying the engine autoescape attribute. So if you create en engine with autoescape=False and then call its render_to_string() method, the result will always be autoescaped. It was p...
swe-bench_data_django__django-11129
Incorrect error message with QuerySet.update() that requires a join on an annotated F expression Description (last modified by Asif Saifuddin Auvi) I ran into a bit of a nasty error yesterday on Django 1.11, Postgres 9.5 where I was trying to do an update using an F expression where the value in that expression...
swe-bench_data_django__django-11133
HttpResponse doesn't handle memoryview objects Description I am trying to write a BinaryField retrieved from the database into a HttpResponse. When the database is Sqlite this works correctly, but Postgresql returns the contents of the field as a memoryview object and it seems like current Django doesn't like this co...
swe-bench_data_django__django-11138
TIME_ZONE value in DATABASES settings is not used when making dates timezone-aware on MySQL, SQLite, and Oracle. Description (last modified by Victor Talpaert) (We assume the mysql backends) I can set TIME_ZONE several times in settings.py, one for the global django app, and one for each database (see ​https://...
swe-bench_data_django__django-11141
Allow migrations directories without __init__.py files Description (last modified by Tim Graham) Background: In python 3 a package with no __init__.py is implicitly a namespace package, so it has no __file__ attribute. The migrate command currently checks for existence of a __file__ attribute on the migrations...
swe-bench_data_django__django-11149
Admin inlines for auto-created ManyToManyFields are editable if the user only has the view permission Description From https://code.djangoproject.com/ticket/8060#comment:34 Replying to Will Gordon: This seems to have regressed in (at least) 2.1. I have 2 view only permissions. I have a ManyToManyField represented in ...
swe-bench_data_django__django-11155
Support setting Secure, HttpOnly, SameSite on the language cookie Description I propose to add the following settings, with the following default values: LANGUAGE_COOKIE_SECURE = False LANGUAGE_COOKIE_HTTPONLY = False LANGUAGE_COOKIE_SAMESITE = None The default values maintain the current behavior. These settings do ...
swe-bench_data_django__django-11163
model_to_dict() should return an empty dict for an empty list of fields. Description Been called as model_to_dict(instance, fields=[]) function should return empty dict, because no fields were requested. But it returns all fields The problem point is if fields and f.name not in fields: which should be if fields is no...
swe-bench_data_django__django-11165
New HTTPRequest.headers not usable in templates because of hyphens Description With the release of 2.2, I took the opportunity from the new ​HTTPRequest.headers object to clean up old code using e.g. request.META['HTTP_X_REAL_IP'] to request.headers['X-Real-IP']. However, this new approach does not work with template...
swe-bench_data_django__django-11166
Admin app has too hard a dependency on sessions app Description Since #29695 (371ece2f0682e51f2f796854d3e091827a7cea63), released in 2.2, the admin app checks whether the django.contrib.sessions app is in INSTALLED_APPS. Some projects may have opted to use a replacement session management app such as ​https://github....
swe-bench_data_django__django-11169
Add new system check message when custom error handler 'path.to.view' cannot be imported Description (last modified by Alasdair Nicol) #29642 added checks for the signatures of custom error handlers. When the 'path.to.view' cannot be imported, it raises ModuleNotFoundError or ViewDoesNotExist, as seen in this S...
swe-bench_data_django__django-11170
UnicodeDecodeError when loading debug templates. Description While studying Django, I had an error where the technical_500.html page was not properly printed. In the log window, UnicodeDecodeError was continuously printed, and in the template, the sentence 'A server error occured. Please contact the administrator' wa...
swe-bench_data_django__django-11177
Django 2.2 autoreloader is failing intermittently (not using watchman) Description Since upgrading to Django 2.2 the autoreloader is working differently and is not always picking up changes to .py files to reload runserver. It seems to work consistently once on a file, but multiple changes to the same file will not n...
swe-bench_data_django__django-11179
delete() on instances of models without any dependencies doesn't clear PKs. Description Deleting any model with no dependencies not updates the PK on the model. It should be set to None after .delete() call. See Django.db.models.deletion:276-281. Should update the model line 280. diff --git a/django/db/models/delet...
swe-bench_data_django__django-11185
Model.delete(keep_parents=True) does not preserve all parent reverse relationships Description (last modified by Stephen Brown) There was a partial fix for this in #27407, but it doesn't cater for relationships toward parents of parents, and so on. diff --git a/django/db/models/deletion.py b/django/db/models/...
swe-bench_data_django__django-11194
Allow specifying a Feed language different from settings.LANGUAGE_CODE Description RSS views.py uses settings.LANGUAGE_CODE as "language tag" for the RSS feed I couldnt find a way to change it.. so I made this patch ​https://github.com/django/django/pull/9879 diff --git a/django/contrib/syndication/views.py b/djang...
swe-bench_data_django__django-11205
Inefficient SQL generated when counting a ManyToMany Description When calling count() on an unfiltered many to many relation, a useless join is included in the SQL that makes it much slower than it should be. On my dataset, the difference is 1000ms to 100ms, because an index-only scan can be used. This is the SQL tha...
swe-bench_data_django__django-11206
utils.numberformat.format renders small decimals in exponential notation. Description When using utils.number_format with decimal_pos, extremely small numbers get displayed using exponential notation. >>> from django.utils.numberformat import format as nformat >>> nformat(Decimal('1e-199'), '.', decimal_pos=2) '0.00'...
swe-bench_data_django__django-11211
Prefetch related is not working when used GFK for model that uses UUID field as PK. Description How to reproduce: create model with UUID as primary key class Foo(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) ... create another model with GFK to model Foo class Bar(models...
swe-bench_data_django__django-11214
Migration re-add check constraint continuously when check condition contains a range object. Description A CheckConstraint with a Q(x__in=range(y, z)) condition is repeatedly deleted and re-added when running makemigrations. models.CheckConstraint( check=models.Q(month__in=range(1, 13)), name='check_valid_month', )...
swe-bench_data_django__django-11216
Prevent ManifestStaticFilesStorage from leaving behind intermediate files Description Currently when using ManifestStaticFilesStorage, collectstatic generates duplicate versions of some files. For example looking at the output for contrib.admin for Django 1.11.5, there is: admin/css/base.css admin/css/base.5af66c1b1...
swe-bench_data_django__django-11234
Prefetch related is not working when used GFK for model that uses FK as PK. Description Steps to reproduce Create Base model with an AutoField primary key class Base(models.Model): title = models.TextField() Create a model where the primary key is also a foreign key class Extended(models.Model): base = models.OneTo...
swe-bench_data_django__django-11239
Add support for postgresql client certificates and key to dbshell. Description This bug is very similar to the #28322 A common security procedure for DB access is to require mutual TLS for the DB connection. This involves specifying a server certificate, client certificate, and client key when connecting. Django alre...
swe-bench_data_django__django-11244
Remove the LANGUAGES_BIDI<=LANGUAGES check. Description (Adding Nick Pope to Cc: as author of the commit referenced below) Since ​https://github.com/django/django/commit/4400d8296d268f5a8523cd02ddc33b12219b2535 there is a system check which verifies that LANGUAGES_BIDI is a subset of LANGUAGES. This breaks almost all...
swe-bench_data_django__django-11260
inspectdb generates unique ForeignKey instead of OneToOneField. Description (last modified by Mariusz Felisiak) inspectdb generates unique ForeignKey instead of OneToOneField that caused raising fields.W342 warnings. diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/i...
swe-bench_data_django__django-11265
Using exclude on annotated FilteredRelation doesn't work Description It looks like using exclude on queryset with annotated FilteredRelation give a FieldError on the annotation name. For exemple, in Django tests (django/tests/filtered_relation/tests.py) if we change this : def test_with_join(self): self.assertSequen...
swe-bench_data_django__django-11270
Add validation of target argument in startapp command. Description When someone calls startapp command with a target argument, The app will overlay on the target directory. If the target directory has invalid name, the app can not be imported. So, I think it would be good to add validation on target directory's name ...
swe-bench_data_django__django-11276
Use Python stdlib html.escape() to in django.utils.html.escape() Description The function django.utils.html.escape() partially duplicates the Python stdlib function html.escape(). We can replace this duplication with wider community developed version. html.escape() has been available since Python 3.2: ​https://docs.p...
swe-bench_data_django__django-11278
Add a system check for uniqueness of partial indexes and constraints names. Description (last modified by Mariusz Felisiak) name is a mandatory field for constraints (check and unique) and partial indexes that must be unique in the database scope. We should add a system check for uniqueness of names. Based on d...
swe-bench_data_django__django-11279
Allow app_label and class to be specified in the name argument for indexes and constraints. Description Allow %(app_label)s and %(class)s to be specified in name argument for BaseConstraint (CheckConstraint, UniqueConstraint) and Index: %(class)s should be replaced by the lowercased name of the child class that the f...
swe-bench_data_django__django-11281
Improve typography of user facing strings. Description Inspired by comment: https://code.djangoproject.com/ticket/30399#comment:2 Prefer: “” for quotes ’ for contractions — rather than -- … rather than ... diff --git a/django/contrib/admin/models.py b/django/contrib/admin/models.py --- a/django/contrib/admin/models...
swe-bench_data_django__django-11283
Migration auth.0011_update_proxy_permissions fails for models recreated as a proxy. Description (last modified by Mariusz Felisiak) I am trying to update my project to Django 2.2. When I launch python manage.py migrate, I get this error message when migration auth.0011_update_proxy_permissions is applying (full...