tethysplatform / tethys

The Tethys Platform main Django website project repository.
http://tethysplatform.org/
BSD 2-Clause "Simplified" License
92 stars 49 forks source link

[BUG] controllers not being found when using user_media #1080

Closed jakeymac closed 2 weeks ago

jakeymac commented 4 weeks ago

Describe the bug When using the user_media argument in the controller decorator, if the url isn't also provided, the controller is not found,

To Reproduce Steps to reproduce the behavior:

  1. Scaffold a new tethys app.
  2. Add a new controller in controllers.py: @controller(user_media=True) def about(request, user_media):
  3. Add a button anywhere in the home page with href to your about controller's url.

Expected behavior Loaidng the home page or the about page should result in an error. After adding the parameter(@controller(user_media=True, url='/about'), the page should load as expected.

Errors/Traceback When loading home.html: NoReverseMatch at /apps/url-issue-test/ Reverse for 'about' with no arguments not found. 1 pattern(s) tried: ['apps/url-issue-test/about/(?P[0-9A-Za-z-_.]+)/$']

When loading the about url by manually entering the about url: Page not found