Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
adega
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
64
Issues
64
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
adega
adega
Commits
42f355ef
Commit
42f355ef
authored
Apr 25, 2019
by
legton
Committed by
bhmeyer
May 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add permission
parent
812aeeeb
Pipeline
#20171
passed with stage
in 2 minutes and 39 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
19 deletions
+4
-19
src/adega/urls.py
src/adega/urls.py
+1
-1
src/cepe9615/models.py
src/cepe9615/models.py
+1
-13
src/cepe9615/views.py
src/cepe9615/views.py
+2
-5
No files found.
src/adega/urls.py
View file @
42f355ef
...
...
@@ -21,7 +21,7 @@ urlpatterns = [
url
(
r'^degree/(?P<submission_id>\w*)/'
,
include
(
'degree.urls'
,
namespace
=
'degree'
)),
url
(
r'^
adega/
cepe9615/(?P<submission_id>\w*)/'
,
include
(
'cepe9615.urls'
,
namespace
=
'cepe9615'
)),
url
(
r'^cepe9615/(?P<submission_id>\w*)/'
,
include
(
'cepe9615.urls'
,
namespace
=
'cepe9615'
)),
url
(
r'^public/'
,
include
(
'public.urls'
,
namespace
=
'public'
)),
...
...
src/cepe9615/models.py
View file @
42f355ef
from
django.db
import
models
from
django.contrib.auth.models
import
User
class
Cepe9615
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
40
)
code
=
models
.
CharField
(
max_length
=
40
)
manager
=
models
.
ForeignKey
(
User
)
def
__str__
(
self
):
return
self
.
name
def
clean_code
(
self
):
if
'/'
in
self
.
code
:
raise
ValidationError
(
'Valor inválido: O código não pode conter "/"'
)
# Create your models here.
src/cepe9615/views.py
View file @
42f355ef
from
django.shortcuts
import
render
,
redirect
from
django.views.generic
import
View
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth
import
logout
as
process_logout
from
report_api.views
import
get_
cepe9615
_information
from
cepe9615.models
import
Cepe9615
from
report_api.views
import
get_
degree
_information
from
degree.models
import
Degree
from
submission.models
import
Submission
import
json
from
guardian.decorators
import
permission_required_or_403
@
permission_required_or_403
(
'view_cepe9615'
,
(
Submission
,
'id'
,
'submission_id'
))
def
index
(
request
,
submission_id
):
submission_id
=
int
(
submission_id
)
...
...
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