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

[WIP]Users-Back-End #234

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

[WIP]Users-Back-End #234

wants to merge 10 commits into from

Conversation

Hepic
Copy link
Collaborator

@Hepic Hepic commented Sep 24, 2017

No description provided.

@Hepic Hepic changed the title [WIP]Back end settings [WIP]Users-Back-End Sep 24, 2017
@Hepic Hepic force-pushed the back-end-settings branch from e915d7a to 49e4ca6 Compare March 7, 2018 09:00
(OTHER, 'Other')
)

user = models.OneToOneField(User, on_delete=models.CASCADE)
Copy link
Owner

Choose a reason for hiding this comment

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

nit


class SessionForm(AuthenticationForm):
username = forms.CharField(max_length=20)
password = forms.CharField(max_length=32, widget=forms.PasswordInput)
Copy link
Owner

Choose a reason for hiding this comment

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

strip=False

code='wrong_password'
)

return "Authenticate"
Copy link
Owner

Choose a reason for hiding this comment

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

Check is_active before authenticating

if password is not None:
raise forms.ValidationError(
'password_set',
code='password_set'
Copy link
Owner

Choose a reason for hiding this comment

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

Fill in at ARCHITECTURE.md

timestamp = timestamp_to_datetime(now)

user.tinguser.last_used = timestamp
user.tinguser.location = "oti na nai"
Copy link
Owner

Choose a reason for hiding this comment

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

Allow NULL


dbmessage = users[0]
self.assertEqual(dbmessage.username, user.username)
self.assertEqual(dbmessage.password, user.password)
Copy link
Owner

Choose a reason for hiding this comment

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

Why is this check needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just to check if both passwords are equal to None.
Do you want to remove it completely ?

if error.code in [
'password_required', 'wrong_password', 'username_reserved'
]:
return HttpResponseForbidden()
Copy link
Owner

Choose a reason for hiding this comment

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

Return the actual string code, for interoperability with other clients.

return HttpResponseForbidden()

if error.code == 'password_set':
return HttpResponseNotFound()
Copy link
Owner

Choose a reason for hiding this comment

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

likewise

return HttpResponseNotFound()

if error.code == 'invalid_username':
return HttpResponseBadRequest()
Copy link
Owner

Choose a reason for hiding this comment

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

likewise

return HttpResponseBadRequest()

elif resp == "Unreserved":
tinguser_form.save()
Copy link
Owner

Choose a reason for hiding this comment

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

where is this defined?

@Hepic Hepic force-pushed the back-end-settings branch 8 times, most recently from 28a0825 to c914142 Compare March 17, 2018 14:33
@Hepic Hepic force-pushed the back-end-settings branch from c914142 to 57d3c7a Compare March 17, 2018 15:23
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.

2 participants