Opened 3 years ago

Closed 2 years ago

#16197 closed Cleanup/optimization (duplicate)

Rewrite contrib auth to use class based views

Reported by: hvdklauw Owned by: hvdklauw
Component: contrib.auth Version: master
Severity: Normal Keywords: dceu2011
Cc: hvdklauw@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Having classed based views for the auth app would make reusing them from your own site with small modifications a lot easier.

Attachments (0)

Change History (11)

comment:1 Changed 3 years ago by hvdklauw

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Working on this during djangocon eu 2011 sprints

comment:2 Changed 3 years ago by hvdklauw

  • Triage Stage changed from Unreviewed to Design decision needed

Right, so I started this, converted login and logout to class based views, changed the current view functions to simply call the class based view and give a PendingDeprecationWarning. Ran the tests, everything is fine.
Changed the in auth to use the Class Based views: Two errors: Tests (and possibly other code) uses the view function dotpath to reverse them, there is no name defined.

How should I solve this?

comment:3 Changed 3 years ago by hvdklauw

Using the old view dotpath as name also doesn't fix the problem, as view lookups are resolved before names and the original view functions still exist.

comment:4 Changed 3 years ago by hvdklauw

  • Keywords dceu2011 added

comment:5 Changed 3 years ago by hvdklauw

  • Triage Stage changed from Design decision needed to Accepted

After talking with Russel and Alex we decided there was no nice way to do this, except in the same way the admin urls handling was changed before.

Alex has some idea's for a Class Based View Collection which basically is a class with class based views that handles the urls.

We'll look into it some more

comment:6 Changed 3 years ago by hvdklauw

Depends on #16213 to be finished first for a nice solution

comment:7 Changed 3 years ago by hvdklauw

  • Cc hvdklauw added

comment:8 Changed 3 years ago by hvdklauw

  • Cc hvdklauw removed

comment:9 Changed 3 years ago by hvdklauw

  • Cc hvdklauw@… added

comment:10 Changed 3 years ago by jacob

  • milestone 1.4 deleted

Milestone 1.4 deleted

comment:11 Changed 2 years ago by anonymous

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

Closing as duplicate of #17209 since it has recent activity and more comments and code.

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.