#5404 error registering user-projects for users whose name has underscore

v1.0.0
closed
sf-1 (616)
General
Cory Johns
2015-08-20
2012-12-04
No

Need to use the existing logic that uses their user id, if the username isn't valid for a project name.

File '/var/local/allura/ForgeWiki/forgewiki/templates/wiki/page_view.html', line 2 in top-level template code
  {% do g.register_forge_css('css/forge/hilite.css', compress=False) %}
File '/var/local/allura/ForgeWiki/forgewiki/templates/wiki/master.html', line 2 in top-level template code
  {% do g.register_app_css('css/wiki.css', compress=False) %}
File '/var/local/allura/Allura/allura/templates/jinja_master/master.html', line 94 in top-level template code
  {% block edit_box %}{% endblock %}
File '/var/local/allura/ForgeWiki/forgewiki/templates/wiki/master.html', line 5 in block "edit_box"
  {% if show_meta %}{% block wiki_meta %}{% endblock %}{% endif %}
File '/var/local/allura/ForgeWiki/forgewiki/templates/wiki/page_view.html', line 59 in block "wiki_meta"
  {{lib.gravatar(author, size=16)}}
File '/var/local/allura/Allura/allura/templates/jinja_master/lib.html', line 15 in template
  {% if user.icon_url() %}
File '<string>', line 2 in icon_url
File '/var/local/allura/Allura/allura/lib/decorators.py', line 196 in memoize
  result = func(*args)
File '/var/local/allura/Allura/allura/model/auth.py', line 484 in icon_url
  private_project = self.private_project()
File '/var/local/allura/Allura/allura/model/auth.py', line 590 in private_project
  p = n.register_project('u/' + self.username, user=self, user_project=True)
File '/var/local/allura/Allura/allura/model/neighborhood.py', line 102 in register_project
  self, shortname, project_name, user or getattr(c, 'user', None), user_project, private_project, apps)
File '/var/local/forge-classic/sfx/sfx_main.py', line 275 in register_project
  user_project, private_project)
File '/var/local/allura/Allura/allura/lib/plugin.py', line 426 in validate_project
  raise ValueError('Invalid project shortname: %s' % shortname)
ValueError: Invalid project shortname: u/n_oostendorp

Related

Tickets: #5433

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-12-04

    allura:db/5404, forge-classic:db/5404

    Tests should cover the case that errored in production. To manually test, recommend to manually create an allura User with invalid punctuation via paster shell (not possible to register such via sfpy user reg), then visit /u/foobar or invoke private_project()

     
  • Dave Brondsema

    Dave Brondsema - 2012-12-04
    • status: in-progress --> code-review
    • qa: Cory Johns
     
  • Cory Johns - 2012-12-04
    • status: code-review --> closed
     

Log in to post a comment.