Modify

Opened 5 years ago

Closed 5 years ago

#6630 closed defect (fixed)

[Patch] Parameter `auth` for anonymous user is None

Reported by: rjollos Owned by: doki_pen
Priority: normal Component: FullBlogAnnouncementsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I was seeing the following error, which appears to be because get_subscriptions_for_event in subscriber.py returns None for an anonymous user, rather than 0.

It seemed like it might be better to fix this in the announcerplugin, so I patched it there for now, and will refer to your expertise as to the best fix.

09:12:44 PM Trac[model] DEBUG: Saving new version 6 of blog post u'Post1' from author 'anonymous'
09:12:45 PM Trac[api] DEBUG: AnnouncementSystem found the following subscribers capable of handling 'blog, post changed': BlogSubscriber
09:12:45 PM Trac[subscriber] DEBUG: BlogSubscriber added 'anonymous (None)' for 'My Post Subscription'
09:12:45 PM Trac[api] DEBUG: AnnouncementSystem has found the following subscriptions: [anonymous(not authenticated) via email]
09:12:45 PM Trac[email_distributor] DEBUG: EmailDistributor has found the following formats capable of handling 'email' of 'blog': text/plain
09:12:45 PM Trac[api] ERROR: AnnouncementSystem failed.
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/announcerplugin/api.py", line 369, in _real_send
    distributor.distribute(transport, packages[transport], evt)
  File "build/bdist.linux-x86_64/egg/announcerplugin/distributors/email_distributor.py", line 192, in distribute
    self._get_preferred_format(event.realm, name, authed) or \
  File "build/bdist.linux-x86_64/egg/announcerplugin/distributors/email_distributor.py", line 250, in _get_preferred_format
    """, (sid, int(authenticated), 'announcer_email_format_%s' % realm))
TypeError: int() argument must be a string or a number, not 'NoneType'
09:12:45 PM Trac[api] DEBUG: AnnouncementSystem sent event in 0.01 seconds.

Attachments (1)

announcerplugin.patch (561 bytes) - added by rjollos 5 years ago.

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by rjollos

comment:1 Changed 5 years ago by doki_pen

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

(In [7686]) avoids exception on authenticated == None

fixes #6630

Add Comment

Modify Ticket

Action
as closed The owner will remain doki_pen.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.