mirror of
https://github.com/makeplane/plane.git
synced 2026-07-14 06:25:58 +02:00
Merge pull request #268 from makeplane/sync/ce-ee
sync: merge conflicts need to be resolved
This commit is contained in:
@@ -16,6 +16,7 @@ from plane.authentication.adapter.error import (
|
||||
AUTHENTICATION_ERROR_CODES,
|
||||
)
|
||||
from django.middleware.csrf import get_token
|
||||
from plane.utils.cache import invalidate_cache
|
||||
|
||||
|
||||
class CSRFTokenEndpoint(APIView):
|
||||
@@ -51,7 +52,6 @@ class ChangePasswordEndpoint(APIView):
|
||||
status=status.HTTP_400_BAD_REQUEST,
|
||||
)
|
||||
|
||||
|
||||
if not user.check_password(old_password):
|
||||
exc = AuthenticationException(
|
||||
error_code=AUTHENTICATION_ERROR_CODES[
|
||||
@@ -69,9 +69,7 @@ class ChangePasswordEndpoint(APIView):
|
||||
results = zxcvbn(new_password)
|
||||
if results["score"] < 3:
|
||||
exc = AuthenticationException(
|
||||
error_code=AUTHENTICATION_ERROR_CODES[
|
||||
"INVALID_NEW_PASSWORD"
|
||||
],
|
||||
error_code=AUTHENTICATION_ERROR_CODES["INVALID_NEW_PASSWORD"],
|
||||
error_message="INVALID_NEW_PASSWORD",
|
||||
)
|
||||
return Response(
|
||||
@@ -89,7 +87,10 @@ class ChangePasswordEndpoint(APIView):
|
||||
status=status.HTTP_200_OK,
|
||||
)
|
||||
|
||||
|
||||
class SetUserPasswordEndpoint(APIView):
|
||||
|
||||
@invalidate_cache("/api/users/me/")
|
||||
def post(self, request):
|
||||
user = User.objects.get(pk=request.user.id)
|
||||
password = request.data.get("password", False)
|
||||
|
||||
@@ -17,7 +17,7 @@ export const IssueReactions: React.FC = () => {
|
||||
{canVote && (
|
||||
<>
|
||||
<div className="flex items-center gap-2">
|
||||
<IssueVotes />
|
||||
<IssueVotes workspaceSlug={workspaceSlug} projectId={projectId} />
|
||||
</div>
|
||||
<div className="h-8 w-0.5 bg-custom-background-200" />
|
||||
</>
|
||||
|
||||
@@ -9,7 +9,12 @@ import { queryParamGenerator } from "@/helpers/query-param-generator";
|
||||
// hooks
|
||||
import { useIssueDetails, useUser } from "@/hooks/store";
|
||||
|
||||
export const IssueVotes: React.FC = observer((props: any) => {
|
||||
type TIssueVotes = {
|
||||
workspaceSlug: string;
|
||||
projectId: string;
|
||||
};
|
||||
|
||||
export const IssueVotes: React.FC<TIssueVotes> = observer((props) => {
|
||||
const router = useRouter();
|
||||
const pathName = usePathname();
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
Reference in New Issue
Block a user