Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
56da9e44
Commit
56da9e44
authored
Apr 09, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move user cleanup to add_suggestion
parent
bb290758
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
trans/models/unit.py
trans/models/unit.py
+3
-0
trans/views/edit.py
trans/views/edit.py
+0
-3
No files found.
trans/models/unit.py
View file @
56da9e44
...
...
@@ -918,6 +918,9 @@ class Unit(models.Model):
from
trans.models.unitdata
import
Suggestion
,
Change
from
accounts.models
import
Profile
if
not
user
.
is_authenticated
():
user
=
None
# Create the suggestion
suggestion
=
Suggestion
.
objects
.
create
(
target
=
target
,
...
...
trans/views/edit.py
View file @
56da9e44
...
...
@@ -24,7 +24,6 @@ from django.template import RequestContext
from
django.http
import
HttpResponseRedirect
,
HttpResponse
from
django.contrib
import
messages
from
django.contrib.auth.decorators
import
login_required
,
permission_required
from
django.contrib.auth.models
import
AnonymousUser
from
django.utils
import
formats
import
uuid
import
time
...
...
@@ -181,8 +180,6 @@ def handle_translate(obj, request, profile, user_locked,
if
'suggest'
in
request
.
POST
:
# Handle suggesion saving
user
=
request
.
user
if
isinstance
(
user
,
AnonymousUser
):
user
=
None
if
form
.
cleaned_data
[
'target'
]
==
len
(
form
.
cleaned_data
[
'target'
])
*
[
''
]:
messages
.
error
(
request
,
_
(
'Your suggestion is empty!'
))
# Stay on same entry
...
...
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