Skip to content
This repository was archived by the owner on Sep 26, 2018. It is now read-only.

Conversation

@piyushabad88
Copy link
Contributor

Hi Steve,

We have updated the code as per your comments.
This sprint can not be grouped in small PRs as we have merged the entire code. But from sprint2 onwards we will logically group the requirements for PRs and deliver it accordingly.

Thanks.

piyush and others added 30 commits April 5, 2017 15:23
Simplify management of CCM repo on GitHub.
This reverts commit 06c22aa.
Fix: Cloud Admin was available to Network Admin and Cloud Admin
Fix: Username replaced with Email
Fix for user role permissions
Code added to ajax request to get permission depending on role
@9muir
Copy link
Contributor

9muir commented May 16, 2017

Given that this is structured as 144 commits it would be possible to go back and create a number of smaller patches, but I understand that doing so would be a non-trivial amount of work.

@facebook-github-bot
Copy link

@9muir has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@9muir 9muir left a comment

Choose a reason for hiding this comment

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

These are just the first round of comments, more to come. Please don't add static third party files.


# To avoid duplicate names while running setup_test_db
# network = Network.objects.create()
network = Network.objects.create(name='Network_%s' % instance.pk)
Copy link
Contributor

Choose a reason for hiding this comment

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

When passing a single value to string formatting operator it's better to pass it as a 1-tuple: (instance.pk, )

Choose a reason for hiding this comment

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

Fixed

network = Network.objects.create()

# To avoid duplicate names while running setup_test_db
# network = Network.objects.create()
Copy link
Contributor

Choose a reason for hiding this comment

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

better to just remove the old line rather than comment it out

Choose a reason for hiding this comment

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

We haven't removed any of the old code which is changed or updated in case it is still required by your team.
Now removed.

profile = UserProfile.objects.create(user=instance)
network = Network.objects.create()

# To avoid duplicate names while running setup_test_db
Copy link
Contributor

Choose a reason for hiding this comment

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

change the comment to 'Add explicit name to avoid duplicate names when running setup_test_db`, to make it clear what you are doing.

Choose a reason for hiding this comment

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

Updated with the mentioned comment

# instance.auth_group, created_group = Group.objects.get_or_create(name='network_%s'
# % instance.pk)
instance.auth_group, created_group = Group.objects.get_or_create(name='%s_GROUP_%s'
% (instance.name, instance.pk))
Copy link
Contributor

Choose a reason for hiding this comment

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

convention would be to put the % at the end of the previous line (and make sure indentation of this line is correct).

Choose a reason for hiding this comment

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

Fixed

# instance.auth_user, created_user = User.objects.get_or_create(username='network_%s'
# % instance.pk)
instance.auth_user, created_user = User.objects.get_or_create(username='%s_USER_%s'
% (instance.name, instance.pk))
Copy link
Contributor

Choose a reason for hiding this comment

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

as above

Choose a reason for hiding this comment

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

Fixed


# Set the context with various stats.
content_type = ContentType.objects.filter(app_label='endagaweb',
model__in=
Copy link
Contributor

Choose a reason for hiding this comment

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

don't break the line here, but you can break after the .

Choose a reason for hiding this comment

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

Fixed. Again it was done due to pylint configuration but for future will keep proper formatting.

# Sending email now to reset password
try:
self._send_reset_link(request)
mail_info = 'Password reset Mail has been sent to %s'% email
Copy link
Contributor

Choose a reason for hiding this comment

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

needs whitespace

Choose a reason for hiding this comment

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

Fixed

print ex
mail_info = '\n Please configure email to send password reset ' \
'link to user'
messages.warning(request, mail_info,extra_tags="alert alert-danger")
Copy link
Contributor

Choose a reason for hiding this comment

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

needs whitespace after comma

Choose a reason for hiding this comment

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

Fixed

return JsonResponse(
{'status': 'success', 'message': 'User added successfully'})


Copy link
Contributor

Choose a reason for hiding this comment

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

don't need two blank lines

Choose a reason for hiding this comment

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

Fixed

current_status = 'Blocked'

if ((
user_profile.user.is_superuser and user_profile.user.is_staff)
Copy link
Contributor

Choose a reason for hiding this comment

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

put and and or at ends of preceding lines

Choose a reason for hiding this comment

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

Fixed

@9muir
Copy link
Contributor

9muir commented May 16, 2017

PLEASE address the comments I made by adding new commits to this PR rather than creating a whole new PR. If you create a new PR it's impossible to track the comments across the new commit(s).

@facebook-github-bot
Copy link

@aricent-ccm updated the pull request - view changes - changes since last import

@facebook-github-bot
Copy link

@9muir has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@aricent-ccm updated the pull request - view changes - changes since last import

@9muir
Copy link
Contributor

9muir commented May 23, 2017

Thanks for addressing my comments. A couple of high-level comments from @kkroo:

Don't worry about addressing the minor points at this time, let's just focus on those two things.

@facebook-github-bot
Copy link

@aricent-ccm updated the pull request - view changes - changes since last import

@9muir
Copy link
Contributor

9muir commented May 26, 2017

Thanks for the updates, will take a look. As discussed on the weekly call, we can't merge them until the changes to use Guardian have been made.

One process point: any time you have a sequence of git commits it should be possible to rewind to any point in that sequence and create a new branch, and thus a new PR. So technically, it is possible to break this PR apart, but at this point it would require a fair amount of work.

@facebook-github-bot
Copy link

@9muir has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@9muir 9muir mentioned this pull request Jun 15, 2017
@facebook-github-bot
Copy link

@aricent-ccm updated the pull request - view changes - changes since last import

@9muir
Copy link
Contributor

9muir commented Jun 17, 2017

Per my comment on #45, please consider closing this PR and making all subsequent changes there. We aren't going to merge these changes until the Guardian integration is complete.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants