Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanups in pootle_notifications views #54

Merged
merged 2 commits into from
Apr 9, 2013

Conversation

unho
Copy link
Member

@unho unho commented Apr 5, 2013

No description provided.

@ghost ghost assigned unho Apr 5, 2013
@julen
Copy link
Contributor

julen commented Apr 8, 2013

Just note that some functionality of the pootle_notifications app is broken since we removed the 'Quick Links' feature in 77e4a79 as part of bug 2531 — lang_filter and proj_filter won't have any effects.
This is not specific to this PR, but might be worth taking that into account and opening a new bug for that.

trans_proj = directory.translation_project
lang = trans_proj.language
proj = trans_proj.project
template_vars['language'] = lang
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be easier to read:

template_vars.update({
    'language': lang,
    'project': proj,
})

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Will change.

@unho
Copy link
Member Author

unho commented Apr 8, 2013

Just note that some functionality of the pootle_notifications app is broken since we removed the 'Quick Links' feature in 77e4a79 as part of bug 2531 — lang_filter and proj_filter won't have any effects.
This is not specific to this PR, but might be worth taking that into account and opening a new bug for that.

If it is not working, because the 'Quick Links' were removed and won't be added again, IMHO then it makes sense to just remove that code and include a commit with those changes in this PR. I don't see the need for filing a bug.

# Take into account 'only active users' flag from the form.
if form.cleaned_data['restrict_to_active_users']:
to_list = to_list.exclude(submission=None).exclude(suggestion=None) \
.exclude(suggester=None)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This three exclude calls perhaps should be changed, because I can't found none of this fields in the PootleProfile model

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, those are foreign key references from the Submission and Suggestion models. If you remove that, you would be emailing all the users in the server with no exception — I doubt you want that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed checking that.

@unho
Copy link
Member Author

unho commented Apr 8, 2013

Added some cleanups and changed others. Better review all commits.

@unho
Copy link
Member Author

unho commented Apr 9, 2013

Updated whole PR:

  • Rebased on top of current master in main repo.
  • Removed some commits,
  • Changed others,
  • Added some new commit,
  • Rearranged most of them in order to have the most problematical ones near to the branch head.

Reviews appreciated. I would like to land the commits that are OK, possibly after squashing them.

if not check_profile_permission(person, 'view', directory):
continue

if person.user.email != '':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if person.user.email would suffice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I will change it.

unho added 2 commits April 9, 2013 16:50
PEP8 cleanups.
Put imports in the right order.
Remove unnecessary or unused code.
title template var is used on RSS so set it always.
Rearrange code to make it more readable and efficient.
Remove title in template since users can see its location in breadcrumbs.
Quoted from Julen comment:

  Just note that some functionality of the pootle_notifications app is broken
  since we removed the 'Quick Links' feature in 77e4a79 as part of bug 2531
  — lang_filter and proj_filter won't have any effects.
@unho unho merged commit e38ca1d into translate:master Apr 9, 2013
julen pushed a commit to julen/pootle that referenced this pull request Mar 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants