Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
d1650cd8
Commit
d1650cd8
authored
Mar 19, 2018
by
markus scheller
Browse files
Merged solve for multiple protocol creations
parents
dc656c3f
75b8fb63
Changes
3
Hide whitespace changes
Inline
Side-by-side
models/database.py
View file @
d1650cd8
...
...
@@ -108,6 +108,12 @@ class ProtocolType(DatabaseModel):
return
None
return
candidates
[
0
]
def
get_protocols_on_date
(
self
,
protocol_date
):
return
[
protocol
for
protocol
in
self
.
protocols
if
protocol
.
date
==
protocol_date
]
def
has_public_view_right
(
self
,
user
,
check_networks
=
True
):
return
(
self
.
has_public_anonymous_view_right
(
check_networks
=
check_networks
)
...
...
@@ -430,7 +436,12 @@ class Protocol(DatabaseModel):
tzinfo
=
tz
.
tzlocal
())
@
staticmethod
def
create_new_protocol
(
protocoltype
,
date
,
start_time
=
None
,
invitation_by
=
None
):
def
create_new_protocol
(
protocoltype
,
date
,
start_time
=
None
,
allow_duplicate
=
False
):
if
not
allow_duplicate
:
duplicate_candidates
=
protocoltype
.
get_protocols_on_date
(
date
)
if
duplicate_candidates
:
return
duplicate_candidates
[
0
]
if
start_time
is
None
:
start_time
=
protocoltype
.
usual_time
if
invitation_by
is
None
:
...
...
server.py
View file @
d1650cd8
...
...
@@ -75,7 +75,7 @@ try:
"release"
:
get_git_revision
(),
}
sentry
.
get_user_info
=
get_user_info
except
ModuleNotFound
Error
:
except
Import
Error
:
print
(
"Raven not installed. Not sending issues to Sentry."
)
except
AttributeError
:
print
(
"DSN not configured. Not sending issues to Sentry."
)
...
...
@@ -91,7 +91,7 @@ def make_celery(app, config):
raven_client
=
RavenClient
(
config
.
SENTRY_DSN
)
register_logger_signal
(
raven_client
)
register_signal
(
raven_client
)
except
ModuleNotFound
Error
:
except
Import
Error
:
print
(
"Raven not installed. Not sending celery issues to Sentry."
)
except
AttributeError
:
print
(
"DSN not configured. Not sending celery issues to Sentry."
)
...
...
@@ -937,7 +937,7 @@ def send_protocol_reminder(protocol):
if
not
config
.
MAIL_ACTIVE
:
flash
(
"Die Mailfunktion ist nicht aktiviert."
,
"alert-error"
)
return
back
.
redirect
(
"show_protocol"
,
protocol_id
=
protocol
.
id
)
meetingreminders
=
protocol
.
reminders
meetingreminders
=
protocol
.
protocoltype
.
reminders
if
len
(
meetingreminders
)
==
0
:
flash
(
"Für diesen Protokolltyp sind keine Einladungsmails "
"konfiguriert."
,
"alert-error"
)
...
...
tasks.py
View file @
d1650cd8
...
...
@@ -492,8 +492,9 @@ def parse_protocol_async_inner(protocol):
if
len
(
protocol_tag
.
values
)
>
1
:
new_protocol_time
=
datetime
.
strptime
(
protocol_tag
.
values
[
1
],
"%H:%M"
)
Protocol
.
create_new_protocol
(
protocol
.
protocoltype
,
new_protocol_date
,
new_protocol_time
)
if
not
protocol
.
protocoltype
.
get_protocols_on_date
(
new_protocol_date
):
Protocol
.
create_new_protocol
(
protocol
.
protocoltype
,
new_protocol_date
,
new_protocol_time
)
# TOPs
old_tops
=
list
(
protocol
.
tops
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment