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

Sourcery refactored master branch #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Aug 30, 2023

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from david1155 August 30, 2023 22:30
if text.startswith(prefix):
return text[len(prefix):]
return text
return text[len(prefix):] if text.startswith(prefix) else text
Copy link
Author

Choose a reason for hiding this comment

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

Function remove_prefix refactored with the following changes:

Comment on lines -29 to +27
vcf = "BEGIN:VCARD"
vcf += "\n"
vcf = "BEGIN:VCARD" + "\n"
Copy link
Author

Choose a reason for hiding this comment

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

Function vCard_gen refactored with the following changes:

@@ -90,7 +87,6 @@ def teardown_request(exception):


@app.route('/')
# @ldap.login_required
Copy link
Author

Choose a reason for hiding this comment

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

Function index refactored with the following changes:

This removes the following comments ( why? ):

# if str(username).casefold() == str(row[9]).casefold():
# @ldap.login_required
#     login_id = row[0]

return render_template('phonebook.html', people=people, login_id=login_id, admin=admin)


@app.route('/new', endpoint='edit', methods=['GET', 'POST'])
@app.route('/edit/<id>', methods=['GET', 'POST'])
# @ldap.login_required
Copy link
Author

Choose a reason for hiding this comment

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

Function edit refactored with the following changes:

This removes the following comments ( why? ):

# @ldap.login_required

Comment on lines -197 to +190
# @ldap.login_required
def delete(id):
username = remove_prefix(session['user_id'], 'MAIN\\')
if username in admin_users:
admin = True
else:
admin = False
admin = username in admin_users
Copy link
Author

Choose a reason for hiding this comment

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

Function delete refactored with the following changes:

This removes the following comments ( why? ):

# @ldap.login_required

Comment on lines -219 to +207
else:
session['user_id'] = remove_prefix(request.form['user'], conf_domain + '\\')
return redirect('/')
session['user_id'] = remove_prefix(request.form['user'], conf_domain + '\\')
return redirect('/')
Copy link
Author

Choose a reason for hiding this comment

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

Function login refactored with the following changes:

Comment on lines -245 to +235
# @ldap.login_required
def vCard_all():
cur = g.db.execute(
'SELECT id, position, lastname, firstname, middlename, intphone, cellphone, email, birthday, login FROM persons WHERE active ORDER BY lastname')
people = []
for row in cur.fetchall():
people.append({
people = [
{
Copy link
Author

Choose a reason for hiding this comment

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

Function vCard_all refactored with the following changes:

This removes the following comments ( why? ):

# @ldap.login_required

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

0 participants