Re: [Django] #28608: Allow UserCreationForm and UserChangeForm to work with custom user models

2024-05-28 Thread Django
#28608: Allow UserCreationForm and UserChangeForm to work with custom user 
models
-+-
 Reporter:  Rômulo Collopy   |Owner:
 Type:   |  shangdahao
  Cleanup/optimization   |   Status:  new
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  user, custom user,   | Triage Stage:  Accepted
  auth   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Sarah Boyce):

 #35484 is a duplicate, this generally tracks the work to make the
 UserAdmin work for custom user models 
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018fbdd3d873-0af3a484-0e04-489f-adde-464df68ea930-00%40eu-central-1.amazonses.com.


Re: [Django] #28608: Allow UserCreationForm and UserChangeForm to work with custom user models

2024-03-18 Thread Django
#28608: Allow UserCreationForm and UserChangeForm to work with custom user 
models
-+-
 Reporter:  Rômulo Collopy   |Owner:
 Type:   |  shangdahao
  Cleanup/optimization   |   Status:  new
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  user, custom user,   | Triage Stage:  Accepted
  auth   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Ülgen Sarıkavak):

 * cc: Ülgen Sarıkavak (added)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e50541286-93a4394b-bb2d-4b04-a676-6a0d4517ed82-00%40eu-central-1.amazonses.com.


Re: [Django] #28608: Allow UserCreationForm and UserChangeForm to work with custom user models

2022-09-20 Thread Django
#28608: Allow UserCreationForm and UserChangeForm to work with custom user 
models
-+-
 Reporter:  Rômulo Collopy   |Owner:  Aman
 Type:   |  Pandey
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  user, custom user,   | Triage Stage:  Accepted
  auth   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Aman Pandey):

 * owner:  shangdahao => Aman Pandey
 * status:  new => assigned


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701835b1ea609-d65c0ebd-4750-48c8-95a2-7c27a790e710-00%40eu-central-1.amazonses.com.


Re: [Django] #28608: Allow UserCreationForm and UserChangeForm to work with custom user models

2019-01-22 Thread Django
#28608: Allow UserCreationForm and UserChangeForm to work with custom user 
models
-+-
 Reporter:  Rômulo Collopy   |Owner:
 Type:   |  shangdahao
  Cleanup/optimization   |   Status:  new
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  user, custom user,   | Triage Stage:  Accepted
  auth   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Lemuel Formacil):

 * cc: Lemuel Formacil (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.6acee90bc7aa649e9b6092309a4c931d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28608: Allow UserCreationForm and UserChangeForm to work with custom user models

2019-01-22 Thread Django
#28608: Allow UserCreationForm and UserChangeForm to work with custom user 
models
-+-
 Reporter:  Rômulo Collopy   |Owner:
 Type:   |  shangdahao
  Cleanup/optimization   |   Status:  new
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  user, custom user,   | Triage Stage:  Accepted
  auth   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Lemuel Formacil):

 Another non-standard behavior of the `UserCreationForm` when used with a
 custom user model is if the model has a `ManyToManyField` the form will
 not save the value of the `ManyToManyField`.  From the
 [[https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-save-
 method|documentation]]:

 > If your model has a many-to-many relation and you specify `commit=False`
 when you save a form, Django cannot immediately save the form data for the
 many-to-many relation. This is because it isn’t possible to save many-to-
 many data for an instance until the instance exists in the database.
 >
 > To work around this problem, every time you save a form using
 `commit=False`, Django adds a `save_m2m()` method to your `ModelForm`
 subclass. After you’ve manually saved the instance produced by the form,
 you can invoke `save_m2m()` to save the many-to-many form data.

 However, the `UserCreationForm.save` method initially calls the form's
 save method with `commit=False` but then doesn't call the `save_m2m`
 method within the `if commit:` block.  The save method should be something
 like this so the form would behave as expected with custom user models
 with a many-to-many relation:

 {{{
 def save(self, commit=True):
 user = super().save(commit=False)
 user.set_password(self.cleaned_data["password1"])
 if commit:
 user.save()
 self.save_m2m()  # added this call to work with models with
 `ManyToManyField`s
 return user
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.328076a33d660dda803f69f724b21ea3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28608: Allow UserCreationForm and UserChangeForm to work with custom user models

2018-09-12 Thread Django
#28608: Allow UserCreationForm and UserChangeForm to work with custom user 
models
-+-
 Reporter:  Rômulo Collopy   |Owner:
 Type:   |  shangdahao
  Cleanup/optimization   |   Status:  new
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  user, custom user,   | Triage Stage:  Accepted
  auth   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * status:  closed => new
 * has_patch:  1 => 0
 * resolution:  fixed =>


Comment:

 In f3fa86a89b3b85242f49b2b9acf58b5ea35acc1f:

 Fixed #29449 -- Reverted "Fixed #28757 -- Allowed using contrib.auth forms
 without installing contrib.auth."

 This reverts commit d935d2914cd80cf31f4803821ad5c0e2a51d due to a
 crash if USERNAME_FIELD isn't a CharField.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.e409882a6e1634deed629b08f7e3e2e4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28608: Allow UserCreationForm and UserChangeForm to work with custom user models

2018-01-05 Thread Django
#28608: Allow UserCreationForm and UserChangeForm to work with custom user 
models
-+-
 Reporter:  Rômulo Collopy   |Owner:
 Type:   |  shangdahao
  Cleanup/optimization   |   Status:  closed
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  user, custom user,   | Triage Stage:  Accepted
  auth   |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"d935d2914cd80cf31f4803821ad5c0e2a51d" d93]:
 {{{
 #!CommitTicketReference repository=""
 revision="d935d2914cd80cf31f4803821ad5c0e2a51d"
 Fixed #28757 -- Allowed using contrib.auth forms without installing
 contrib.auth.

 Also fixed #28608 -- Allowed UserCreationForm and UserChangeForm to
 work with custom user models.

 Thanks Sagar Chalise and Rômulo Collopy for reports, and Tim Graham
 and Tim Martin for reviews.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.7dd346f3e2818b758c2a668eb08edf23%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28608: Allow UserCreationForm and UserChangeForm to work with custom user models

2017-11-17 Thread Django
#28608: Allow UserCreationForm and UserChangeForm to work with custom user 
models
-+-
 Reporter:  Rômulo Collopy   |Owner:  hui shang
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  user, custom user,   | Triage Stage:  Accepted
  auth   |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by hui shang):

 * status:  new => assigned
 * needs_better_patch:  1 => 0
 * owner:  nobody => hui shang


Comment:

 Since This ticket is related to
 [https://code.djangoproject.com/ticket/28757  ticket 28757], I made the
 changes for this ticket and ticket 28757 in the same commit.

 [https://github.com/django/django/pull/9354 PR]

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.9bcd99d9af7b6806f24e0e0d9de7561b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28608: Allow UserCreationForm and UserChangeForm to work with custom user models

2017-09-26 Thread Django
#28608: Allow UserCreationForm and UserChangeForm to work with custom user 
models
-+-
 Reporter:  Rômulo Collopy   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  user, custom user,   | Triage Stage:  Accepted
  auth   |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.84b55c8aeaba44ba08889b1bdf7dd03b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28608: Allow UserCreationForm and UserChangeForm to work with custom user models (was: UserCreationForm and UserChangeForm model using get_user_model)

2017-09-26 Thread Django
#28608: Allow UserCreationForm and UserChangeForm to work with custom user 
models
-+-
 Reporter:  Rômulo Collopy   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  user, custom user,   | Triage Stage:
  auth   |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * needs_better_patch:  0 => 1


Comment:

 This is a continuation of #19353.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.bd32e5f74a85404dd1a695c5b15515de%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.