Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Alsijil
Commits
d1f104f9
Verified
Commit
d1f104f9
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Simplify request getter in forms
parent
0985aa3c
No related branches found
No related tags found
1 merge request
!49
Resolve "Add rules and permissions"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/forms.py
+1
-1
1 addition, 1 deletion
aleksis/apps/alsijil/forms.py
aleksis/apps/alsijil/views.py
+1
-1
1 addition, 1 deletion
aleksis/apps/alsijil/views.py
with
2 additions
and
2 deletions
aleksis/apps/alsijil/forms.py
+
1
−
1
View file @
d1f104f9
...
...
@@ -133,7 +133,7 @@ class RegisterAbsenceForm(forms.Form):
remarks
=
forms
.
CharField
(
label
=
_
(
"
Remarks
"
),
max_length
=
30
,
required
=
False
)
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
request
=
kwargs
.
pop
(
"
request
"
)
self
.
request
=
get_
request
(
)
super
().
__init__
(
*
args
,
**
kwargs
)
period_choices
=
TimePeriod
.
period_choices
if
check_global_permission
(
self
.
request
.
user
,
"
alsijil.register_absence
"
):
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/views.py
+
1
−
1
View file @
d1f104f9
...
...
@@ -643,7 +643,7 @@ def overview_person(request: HttpRequest, id_: Optional[int] = None) -> HttpResp
def
register_absence
(
request
:
HttpRequest
)
->
HttpResponse
:
context
=
{}
register_absence_form
=
RegisterAbsenceForm
(
request
.
POST
or
None
,
request
=
request
)
register_absence_form
=
RegisterAbsenceForm
(
request
.
POST
or
None
)
if
request
.
method
==
"
POST
"
:
if
register_absence_form
.
is_valid
()
and
request
.
user
.
has_perm
(
...
...
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