Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Helios Server
Commits
b4a7421e
Commit
b4a7421e
authored
15 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
Added auto election creation, with proper params
parent
b843cabf
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
helios
+1
-1
1 addition, 1 deletion
helios
iacr/urls.py
+2
-1
2 additions, 1 deletion
iacr/urls.py
iacr/views.py
+28
-12
28 additions, 12 deletions
iacr/views.py
settings.py
+1
-1
1 addition, 1 deletion
settings.py
with
32 additions
and
15 deletions
helios
@
ef0ee6f5
Compare
d7ed9561
...
ef0ee6f5
Subproject commit
d7ed95619a63e1e5745f43427e9dbc0f8df0d028
Subproject commit
ef0ee6f5e0fa2307f87998065fd0ff2aa6e29d07
This diff is collapsed.
Click to expand it.
iacr/urls.py
+
2
−
1
View file @
b4a7421e
...
@@ -5,5 +5,6 @@ from views import *
...
@@ -5,5 +5,6 @@ from views import *
urlpatterns
=
patterns
(
''
,
urlpatterns
=
patterns
(
''
,
(
r
'
^$
'
,
home
),
(
r
'
^$
'
,
home
),
(
r
'
^about$
'
,
about
)
(
r
'
^about$
'
,
about
),
(
r
'
^cast$
'
,
cast
)
)
)
This diff is collapsed.
Click to expand it.
iacr/views.py
+
28
−
12
View file @
b4a7421e
...
@@ -7,24 +7,40 @@ from auth.security import *
...
@@ -7,24 +7,40 @@ from auth.security import *
from
view_utils
import
*
from
view_utils
import
*
import
helios.views
import
helios.views
import
helios
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.http
import
HttpResponse
,
HttpResponseRedirect
,
Http404
,
HttpResponseNotAllowed
from
django.http
import
HttpResponse
,
HttpResponseRedirect
,
Http404
,
HttpResponseNotAllowed
def
home
(
request
):
def
home
(
request
):
user
=
get_user
(
request
)
# create the election if need be
if
user
:
election_params
=
{
elections
=
Election
.
get_by_user_as_admin
(
user
)
'
short_name
'
:
'
iacr09
'
,
elections_registered
=
Election
.
get_by_user_as_voter
(
user
)
'
name
'
:
'
IACR 2009 Election
'
,
else
:
'
description
'
:
'
Election for the IACR Board - 2009
'
,
elections
=
[]
'
uuid
'
:
'
iacr
'
,
elections_registered
=
[]
'
cast_url
'
:
reverse
(
cast
),
'
self_registration
'
:
False
,
'
openreg
'
:
False
,
'
admin
'
:
helios
.
ADMIN
}
election
=
Election
.
get_by_key_name
(
election_params
[
'
short_name
'
])
if
not
election
:
election
=
Election
(
key_name
=
election_params
[
'
short_name
'
],
**
election_params
)
election
.
put
()
return
render_template
(
request
,
"
index
"
,
{
'
elections
'
:
elections
,
'
elections_registered
'
:
elections_registered
}
)
return
render_template
(
request
,
"
index
"
)
def
about
(
request
):
def
about
(
request
):
return
HttpResponse
(
request
,
"
about
"
)
return
HttpResponse
(
request
,
"
about
"
)
def
election_shortcut
(
request
,
election_short_name
):
@helios.views.election_view
(
frozen
=
True
)
election
=
Election
.
get_by_short_name
(
election_short_name
)
def
cast
(
request
,
election
):
return
HttpResponseRedirect
(
reverse
(
helios
.
views
.
one_election_view
,
args
=
[
election
.
uuid
]))
if
request
.
method
==
"
GET
"
:
\ No newline at end of file
encrypted_vote
=
request
.
POST
[
'
encrypted_vote
'
]
request
.
session
[
'
encrypted_vote
'
]
=
encrypted_vote
return
render_template
(
request
,
"
cast
"
,
{
'
election
'
:
election
})
else
:
# do the casting
pass
This diff is collapsed.
Click to expand it.
settings.py
+
1
−
1
View file @
b4a7421e
...
@@ -127,4 +127,4 @@ TEMPLATE_DEBUG = True
...
@@ -127,4 +127,4 @@ TEMPLATE_DEBUG = True
URL_HOST
=
"
https://iacr-helios.appspot.com
"
URL_HOST
=
"
https://iacr-helios.appspot.com
"
IACR_ELECTION_UUID
=
'
2d52d7fd-7d94-11de-b131-ed929ff4d68f
'
IACR_ELECTION_UUID
=
'
iacr
'
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment