Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #30 from fedora-infra/feature/still-more-default-t…
Browse files Browse the repository at this point in the history
…weaking

Still more defaults tweaking
  • Loading branch information
ralphbean committed Jan 14, 2015
2 parents 1466546 + 811054e commit 962c9ec
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions fmn/lib/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@

# Don't tell me about my own bodhi activity, but do tell me if other people
# do bodhi stuff to my packages.
'bodhi_buildroot_override_untag',
'bodhi_buildroot_override_tag',
'bodhi_update_request_stable',
'bodhi_update_request_obsolete',
'bodhi_update_request_testing',
'bodhi_update_request_unpush',
'bodhi_update_request_revoke',
## Except, comments. Comments are nice to get.
#'bodhi_update_comment',
'bodhi_catchall',

# Don't tell me about my own bugzilla activity, but I do want to know if
# other people act on bugs on my packages.
Expand Down Expand Up @@ -228,14 +220,23 @@ def contexts():
else:
log.warn("No such context %r is in the DB." % name)

# For each context, build two big filters
# For each context, build one little and two big filters
for context in contexts():
pref = fmn.lib.models.Preference.load(session, user, context)
if not pref:
value = detail_values.get(context.name)
pref = fmn.lib.models.Preference.create(
session, user, context, detail_value=value)

# Add a special filter that looks for mentions like @ralph
filt = fmn.lib.models.Filter.create(
session, "Mentions of my @username")
pattern = '[!-~ ]*[^\w@]@%s[^\w@][!-~ ]*' % nick
filt.add_rule(session, valid_paths,
"fmn.rules:regex_filter", pattern=pattern)
pref.add_filter(session, filt, notify=True)
# END @username filter

# Add a filter that looks for packages of this user
filt = fmn.lib.models.Filter.create(
session, "Events on packages that I own")
Expand Down

0 comments on commit 962c9ec

Please sign in to comment.