Code

Opened 7 months ago

Closed 7 months ago

#21228 closed Cleanup/optimization (fixed)

More explicit message for GeometryProxy set error on type mismatch

Reported by: Étienne Loks <etienne.loks@…> Owned by: nobody
Component: GIS Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

class MyModel(models.Models):
  localisation = models.MultiPolygonField() 
  ...

my.localisation = Polygon(([0,1], [1,1], [1, 0], [0,0], [0,1]))
>>> cannot set MyModel GeometryProxy with value of type: <class 'django.contrib.gis.geos.geometries.Polygon'>

To be more relevant the error message should explain what kind of geometry is attended by GeometryProxy.

Attachments (1)

patch.diff (720 bytes) - added by Étienne Loks <etienne.loks@…> 7 months ago.

Download all attachments as: .zip

Change History (3)

Changed 7 months ago by Étienne Loks <etienne.loks@…>

comment:1 Changed 7 months ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 months ago by claudep

  • Resolution set to fixed
  • Status changed from new to closed

Thanks for the suggestion, fixed in [8d75d1e1bc6052f934b3fc066cd362dae75e99a3].

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.