Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
a3787b45
Commit
a3787b45
authored
Apr 08, 2016
by
David Haynes
🙆
Browse files
Comments seperate out imports for less messiness
- git add --all
parent
25215037
Changes
4
Hide whitespace changes
Inline
Side-by-side
go/go/admin.py
View file @
a3787b45
# Django Imports
from
django.contrib
import
admin
# App Imports
from
go.models
import
URL
,
RegisteredUser
...
...
go/go/cas_callbacks.py
View file @
a3787b45
from
__future__
import
absolute_import
,
print_function
# Django Imports
from
django.contrib.auth.models
import
User
from
django.conf
import
settings
# Other Imports
import
requests
from
__future__
import
absolute_import
,
print_function
def
pfparse
(
pf_name_result
):
# name comes in format of Anderson, Nicholas J
...
...
@@ -68,7 +69,7 @@ def create_user_dud(tree):
user
.
set_password
(
"cas_used_instead"
)
# a list of empty strings is False
if
not
info_name
:
if
not
info_name
:
user
.
first_name
=
info_name
[
0
]
user
.
last_name
=
info_name
[
1
]
print
(
"Added user's name, %s %s."
%
(
info_name
[
0
],
info_name
[
1
]))
...
...
@@ -122,4 +123,4 @@ def create_user(tree):
print
(
"CAS callback successful."
)
except
Exception
as
e
:
print
(
"Unhandled user creation error:"
,
e
)
# mail the administrators
\ No newline at end of file
# mail the administrators
go/go/forms.py
View file @
a3787b45
# Django Imports
from
django
import
forms
from
go.models
import
URL
,
RegisteredUser
from
django.core.exceptions
import
ValidationError
from
django.utils.safestring
import
mark_safe
# App Imports
from
go.models
import
URL
,
RegisteredUser
# Other Imports
from
crispy_forms.helper
import
FormHelper
from
crispy_forms.layout
import
Layout
,
Fieldset
,
Submit
,
HTML
,
Div
,
Field
from
crispy_forms.bootstrap
import
StrictButton
,
PrependedText
,
Accordion
,
AccordionGroup
...
...
go/go/models.py
View file @
a3787b45
# Django Imports
from
django.db
import
models
from
django.contrib.auth.models
import
User
from
django.utils
import
timezone
from
django.core.cache
import
cache
# from django.conf import settings
import
string
# random
# Other Imports
import
string
from
hashids
import
Hashids
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment